lkml.org 
[lkml]   [2023]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 4/9] mm/page_alloc.c: allow oversized movablecore
    Date
    Now that the error in computation of corepages has been corrected
    by commit 9fd745d450e7 ("mm: fix overflow in
    find_zone_movable_pfns_for_nodes()"), oversized specifications of
    movablecore will result in a zero value for required_kernelcore if
    it is not also specified.

    It is unintuitive for such a request to lead to no ZONE_MOVABLE
    memory when the kernel parameters are clearly requesting some.

    The current behavior when requesting an oversized kernelcore is to
    classify all of the pages in movable_zone as kernelcore. The new
    behavior when requesting an oversized movablecore (when not also
    specifying kernelcore) is to similarly classify all of the pages
    in movable_zone as movablecore.

    Signed-off-by: Doug Berger <opendmb@gmail.com>
    ---
    mm/page_alloc.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/mm/page_alloc.c b/mm/page_alloc.c
    index 827b4bfef625..e574c6a79e2f 100644
    --- a/mm/page_alloc.c
    +++ b/mm/page_alloc.c
    @@ -8166,13 +8166,13 @@ static void __init find_zone_movable_pfns_for_nodes(void)
    corepages = totalpages - required_movablecore;

    required_kernelcore = max(required_kernelcore, corepages);
    + } else if (!required_kernelcore) {
    + /* If kernelcore was not specified, there is no ZONE_MOVABLE */
    + goto out;
    }

    - /*
    - * If kernelcore was not specified or kernelcore size is larger
    - * than totalpages, there is no ZONE_MOVABLE.
    - */
    - if (!required_kernelcore || required_kernelcore >= totalpages)
    + /* If kernelcore size exceeds totalpages, there is no ZONE_MOVABLE */
    + if (required_kernelcore >= totalpages)
    goto out;

    /* usable_startpfn is the lowest possible pfn ZONE_MOVABLE can be at */
    --
    2.34.1
    \
     
     \ /
      Last update: 2023-03-27 00:54    [W:4.500 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site