Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2154377imm; Thu, 21 Jun 2018 08:01:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFO0EvNSMrEju4lHs6xTEne308l8ROFYJsjT2GC9zfClwUmDaidCkr4/7k5TgJiI27i6+J X-Received: by 2002:a63:2682:: with SMTP id m124-v6mr22883147pgm.56.1529593315231; Thu, 21 Jun 2018 08:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529593315; cv=none; d=google.com; s=arc-20160816; b=Hmzw24e5PjfFAC4zW75tNW7KXWAb0EscQlYbumAwjdIyfAeN4GUtUvEx4ZJvQAjdDA lLzkydjEl0nvVpVl7TVEj45gbT4BYzreU4tRfrlQ2AEoQiWHLwI5CWoOpeg2Q/dWqiO/ mMgKdH85s0mqYCdZ2bbkXpKdTkPSnuTTwgOQ2zSeP78j+fvWLXkxTEaKCAJw563T9KM5 B6+wnK/4Dv4B/+cBNiO7hDcgulp88lQf/gIrMR/0+AhUAeqr7HraPHqJItGyk0xwK0B6 Ln0BdPv/PTQgnE/tnVg+iJEduiUuq2erTvObji7o+xUBpaK8Qk3iq7B/6K26l1lbpy7x TbVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=wI+cgXg8evNzghnNoIZRsE/+8817CV7wM1H5VrGRP/I=; b=eE189T8XSGE3j1NawuxHNMveGwgp45iUCVVarMu4/268jyq/eYWU54MFeUvmVNiny0 YhRK2LyIm3GAUgZFLCAzw0fR1At2706ZcJw8Uc6xRspRFqmOuCODs9DBOUPVJJvW6lEi loWkr2QsyifQfS4C89GWyHXtpxZf1KebOJyBw8Uv4Dj2UuNhxpeA497UZCU5ulZPNooh cZKg5NOwc6xkyqRmgWL3zEU2ClVcwBQ5/O69l2AQEAi52puhJOBlp98YCvjL2uu7aQzF 215ewxv378ZFp7VvP4sioEzsnFvApfcxqC0kMa1Hyu4o8SZFIK90dLto4rsV/EXTHjwB lpDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l65-v6si4096292pge.46.2018.06.21.08.01.39; Thu, 21 Jun 2018 08:01:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933256AbeFUO7v (ORCPT + 99 others); Thu, 21 Jun 2018 10:59:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:60877 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932981AbeFUO7u (ORCPT ); Thu, 21 Jun 2018 10:59:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 210BEAC69; Thu, 21 Jun 2018 14:59:49 +0000 (UTC) Date: Thu, 21 Jun 2018 16:59:47 +0200 From: Michal Hocko To: Jia-Ju Bai Cc: akpm@linux-foundation.org, jthumshirn@suse.de, cl@linux.com, kstewart@linuxfoundation.org, pombredanne@nexb.com, gregkh@linuxfoundation.org, dvyukov@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: mempool: Remove unused argument in kasan_unpoison_element() and remove_element() Message-ID: <20180621145947.GA13063@dhcp22.suse.cz> References: <20180621070332.16633-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180621070332.16633-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 21-06-18 15:03:32, Jia-Ju Bai wrote: > The argument "gfp_t flags" is not used in kasan_unpoison_element() > and remove_element(), so remove it. yeah, seems like left over from 9b75a867cc9d ("mm: mempool: kasan: don't poot mempool objects in quarantine") > Signed-off-by: Jia-Ju Bai Acked-by: Michal Hocko > --- > mm/mempool.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/mm/mempool.c b/mm/mempool.c > index 5c9dce34719b..3076ab3f7bc4 100644 > --- a/mm/mempool.c > +++ b/mm/mempool.c > @@ -111,7 +111,7 @@ static __always_inline void kasan_poison_element(mempool_t *pool, void *element) > kasan_free_pages(element, (unsigned long)pool->pool_data); > } > > -static void kasan_unpoison_element(mempool_t *pool, void *element, gfp_t flags) > +static void kasan_unpoison_element(mempool_t *pool, void *element) > { > if (pool->alloc == mempool_alloc_slab || pool->alloc == mempool_kmalloc) > kasan_unpoison_slab(element); > @@ -127,12 +127,12 @@ static __always_inline void add_element(mempool_t *pool, void *element) > pool->elements[pool->curr_nr++] = element; > } > > -static void *remove_element(mempool_t *pool, gfp_t flags) > +static void *remove_element(mempool_t *pool) > { > void *element = pool->elements[--pool->curr_nr]; > > BUG_ON(pool->curr_nr < 0); > - kasan_unpoison_element(pool, element, flags); > + kasan_unpoison_element(pool, element); > check_element(pool, element); > return element; > } > @@ -151,7 +151,7 @@ void mempool_destroy(mempool_t *pool) > return; > > while (pool->curr_nr) { > - void *element = remove_element(pool, GFP_KERNEL); > + void *element = remove_element(pool); > pool->free(element, pool->pool_data); > } > kfree(pool->elements); > @@ -247,7 +247,7 @@ int mempool_resize(mempool_t *pool, int new_min_nr) > spin_lock_irqsave(&pool->lock, flags); > if (new_min_nr <= pool->min_nr) { > while (new_min_nr < pool->curr_nr) { > - element = remove_element(pool, GFP_KERNEL); > + element = remove_element(pool); > spin_unlock_irqrestore(&pool->lock, flags); > pool->free(element, pool->pool_data); > spin_lock_irqsave(&pool->lock, flags); > @@ -333,7 +333,7 @@ void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask) > > spin_lock_irqsave(&pool->lock, flags); > if (likely(pool->curr_nr)) { > - element = remove_element(pool, gfp_temp); > + element = remove_element(pool); > spin_unlock_irqrestore(&pool->lock, flags); > /* paired with rmb in mempool_free(), read comment there */ > smp_wmb(); > -- > 2.17.0 -- Michal Hocko SUSE Labs