Re: [PATCH] swap migration: Fix lru drain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 7 Dec 2005, Andrew Morton wrote:

> I'll change this to return 0 on success, or -ENOMEM.  Bit more
> conventional, no?

Ok. That also allows the addition of other error conditions in the future.
Need to revise isolate_lru_page to reflect that.

Index: linux-2.6.15-rc5-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.15-rc5-mm1.orig/mm/vmscan.c	2005-12-06 18:03:24.000000000 -0800
+++ linux-2.6.15-rc5-mm1/mm/vmscan.c	2005-12-07 17:11:58.000000000 -0800
@@ -1038,8 +1038,8 @@ redo:
 		 * Maybe this page is still waiting for a cpu to drain it
 		 * from one of the lru lists?
 		 */
-		schedule_on_each_cpu(lru_add_drain_per_cpu, NULL);
-		if (PageLRU(page))
+		rc = schedule_on_each_cpu(lru_add_drain_per_cpu, NULL);
+		if (rc == 0 && PageLRU(page))
 			goto redo;
 	}
 	return rc;
Index: linux-2.6.15-rc5-mm1/kernel/workqueue.c
===================================================================
--- linux-2.6.15-rc5-mm1.orig/kernel/workqueue.c	2005-12-07 16:38:54.000000000 -0800
+++ linux-2.6.15-rc5-mm1/kernel/workqueue.c	2005-12-07 17:13:04.000000000 -0800
@@ -432,7 +432,7 @@ int schedule_on_each_cpu(void (*func) (v
 	work = kmalloc(NR_CPUS * sizeof(struct work_struct), GFP_KERNEL);
 
 	if (!work)
-		return 0;
+		return -ENOMEM;
 	for_each_online_cpu(cpu) {
 		INIT_WORK(work + cpu, func, info);
 		__queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu),
@@ -440,7 +440,7 @@ int schedule_on_each_cpu(void (*func) (v
 	}
 	flush_workqueue(keventd_wq);
 	kfree(work);
-	return 1;
+	return 0;
 }
 
 void flush_scheduled_work(void)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux