lkml.org 
[lkml]   [2012]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/3] uprobes: change build_map_info() to try kmalloc(GFP_NOWAIT) first
    On 06/04, Oleg Nesterov wrote:
    >
    > @@ -772,8 +772,13 @@ build_map_info(struct address_space *mapping, loff_t offset, bool is_register)
    > continue;
    >
    > if (!prev) {
    > - more++;
    > - continue;
    > + prev = kmalloc(sizeof(struct map_info),
    > + GFP_NOWAIT | __GFP_NOMEMALLOC | __GFP_NOWARN);
    > + if (!prev) {
    > + more++;
    > + continue;
    > + }
    > + prev->next = NULL;
    > }

    OK, this is not exactly right, it is pointless and wrong to
    do kmalloc(GFP_NOWAIT) if it failed before (iow, more != 0).

    Easy to fix, I'll send v2 tomorrow.

    Oleg.



    \
     
     \ /
      Last update: 2012-06-05 13:01    [W:0.024 / U:31.524 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site