lkml.org 
[lkml]   [2013]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/4] mm/pgtable: Fix continue to preallocate pmds even if failure occurrence
    Date
    preallocate_pmds will continue to preallocate pmds even if failure 
    occurrence, and then free all the preallocate pmds if there is
    failure, this patch fix it by stop preallocate if failure occurrence
    and go to free path.

    Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
    ---
    arch/x86/mm/pgtable.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
    index dfa537a..ad3397a 100644
    --- a/arch/x86/mm/pgtable.c
    +++ b/arch/x86/mm/pgtable.c
    @@ -200,8 +200,10 @@ static int preallocate_pmds(pmd_t *pmds[])

    for(i = 0; i < PREALLOCATED_PMDS; i++) {
    pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP);
    - if (pmd == NULL)
    + if (pmd == NULL) {
    failed = true;
    + break;
    + }
    pmds[i] = pmd;
    }

    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-08-15 02:41    [W:2.142 / U:0.468 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site