The patch titled Subject: mm/vmalloc.c: don't reinvent the wheel but use existing llist API has been added to the -mm tree. Its filename is mm-dont-reinvent-the-wheel-but-use-existing-llist-api.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-dont-reinvent-the-wheel-but-use-existing-llist-api.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-dont-reinvent-the-wheel-but-use-existing-llist-api.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Byungchul Park <byungchul.park@xxxxxxx> Subject: mm/vmalloc.c: don't reinvent the wheel but use existing llist API Although llist provides proper APIs, they are not used. Make them used. Link: http://lkml.kernel.org/r/1502095374-16112-1-git-send-email-byungchul.park@xxxxxxx Signed-off-by: Byungchul Park <byungchul.park@xxxxxxx> Cc: zijun_hu <zijun_hu@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Joel Fernandes <joelaf@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/vmalloc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff -puN mm/vmalloc.c~mm-dont-reinvent-the-wheel-but-use-existing-llist-api mm/vmalloc.c --- a/mm/vmalloc.c~mm-dont-reinvent-the-wheel-but-use-existing-llist-api +++ a/mm/vmalloc.c @@ -49,12 +49,10 @@ static void __vunmap(const void *, int); static void free_work(struct work_struct *w) { struct vfree_deferred *p = container_of(w, struct vfree_deferred, wq); - struct llist_node *llnode = llist_del_all(&p->list); - while (llnode) { - void *p = llnode; - llnode = llist_next(llnode); - __vunmap(p, 1); - } + struct llist_node *t, *llnode; + + llist_for_each_safe(llnode, t, llist_del_all(&p->list)) + __vunmap((void *)llnode, 1); } /*** Page table manipulation functions ***/ _ Patches currently in -mm which might be from byungchul.park@xxxxxxx are mm-dont-reinvent-the-wheel-but-use-existing-llist-api.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html