ChangeSet 1.2229, 2005/03/31 08:27:39-08:00, [EMAIL PROTECTED]

        [PATCH] cpusets: special-case GFP_ATOMIC allocs
        
        Stringent enforcement of cpuset memory placement could cause the kernel
        to fail a GFP_ATOMIC (!wait) memory allocation, even though memory was
        available elsewhere in the system.
        
        Relax the cpuset constraint, on the last zone loop in
        mm/page_alloc.c:__alloc_pages(), for ATOMIC requests. 
        
        Signed-off-by: Paul Jackson <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 Documentation/cpusets.txt |    8 ++++++++
 mm/page_alloc.c           |    5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)


diff -Nru a/Documentation/cpusets.txt b/Documentation/cpusets.txt
--- a/Documentation/cpusets.txt 2005-03-31 10:09:51 -08:00
+++ b/Documentation/cpusets.txt 2005-03-31 10:09:51 -08:00
@@ -261,6 +261,14 @@
 code should reconfigure cpusets to only refer to online CPUs and Memory
 Nodes when using hotplug to add or remove such resources.
 
+There is a second exception to the above.  GFP_ATOMIC requests are
+kernel internal allocations that must be satisfied, immediately.
+The kernel may panic if such a requested page is not allocated.
+If such a request cannot be satisfied within the cpusets allowed
+memory, then we relax the cpuset boundaries and allow any page in
+the system to satisfy a GFP_ATOMIC request.  It is better to violate
+the cpuset constraints than it is to panic the kernel.
+
 To start a new job that is to be contained within a cpuset, the steps are:
 
  1) mkdir /dev/cpuset
diff -Nru a/mm/page_alloc.c b/mm/page_alloc.c
--- a/mm/page_alloc.c   2005-03-31 10:09:51 -08:00
+++ b/mm/page_alloc.c   2005-03-31 10:09:51 -08:00
@@ -780,6 +780,9 @@
        /*
         * Go through the zonelist again. Let __GFP_HIGH and allocations
         * coming from realtime tasks to go deeper into reserves
+        *
+        * This is the last chance, in general, before the goto nopage.
+        * Ignore cpuset if GFP_ATOMIC (!wait) - better that than panic.
         */
        for (i = 0; (z = zones[i]) != NULL; i++) {
                if (!zone_watermark_ok(z, order, z->pages_min,
@@ -787,7 +790,7 @@
                                       gfp_mask & __GFP_HIGH))
                        continue;
 
-               if (!cpuset_zone_allowed(z))
+               if (wait && !cpuset_zone_allowed(z))
                        continue;
 
                page = buffered_rmqueue(z, order, gfp_mask);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to