Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1211877ybz; Thu, 16 Apr 2020 05:09:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLWrPmJMrZa6B5KUE10qOFw8nyl/nephnkQWDOZ2S+Np7ZNRdbSjQQBp/A2h9RhngkKm1L4 X-Received: by 2002:a50:c389:: with SMTP id h9mr29752456edf.1.1587038958958; Thu, 16 Apr 2020 05:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587038958; cv=none; d=google.com; s=arc-20160816; b=kjcBUdwME5PJ7ISCjD92NgWmOagxTsb1P7QVNuH8V/JUAh8lB5zatlfTC9YRJjSge9 kAWlprTidc94m6k75cMRi/oX3RDQvovmC1oGauJafwG0fCHib9UQzAielW0obGijXZ+B 1Ma3ZXeF+SOvD0MNFYLlknpxZNoINdRe6nbujr7ScJaxneMR/L0sF1OIq4+sBsOkI5TD 6oihXeRWNkC5u5qT23QbPdrgTcDo/om77S0GPeSqhXONipJfLTEsIR+PVazJLLTaS0Rl Y8QvKCWBsIvQ8c9IaHFGWmxWawZkFakj1kgk6syXdqrVjzSUjGM+rPSZ2weGgCco8V8G ZFRw== 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; bh=uFewMZ2kzJZg69lXmgehWe2fbtqBmqcXjAa6fAYvZ5Y=; b=MKsE41TpoiG2OsHR2cDRYW0iznyLmWts5KPE9cA6NkBTLfKHUxCqvwz0jIE6B/8O8J jEiJ3GB+ypLN/OmovTX03ge0LoygjF663hTaTnTSNLTo57VmnLWfcXNLySVBNOJBd3py 2pZYw+0V+hAp5yBkunwNCPBNlczneAJwkObFQKLYlreX8Ub79ONNf09Lj45L/U/584YT sKoQ7oSt/QJDf54KxPY3Sp3+IrH8Phy5I7+VmdJE1GWgoWeUNBmAsYEffHjVLLLcOBCn wNSz6FMG4vuQG2GQPLPjhchluGpRSiTPb/UwAgUL1LHzFyXqE67JCUK3oAbnjXfr3gbK aWxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh3si11546500ejb.177.2020.04.16.05.08.55; Thu, 16 Apr 2020 05:09:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634959AbgDPMHJ (ORCPT + 99 others); Thu, 16 Apr 2020 08:07:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:40712 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2634831AbgDPMHC (ORCPT ); Thu, 16 Apr 2020 08:07:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 475AEAC6D; Thu, 16 Apr 2020 12:06:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 6CFFC1E1250; Thu, 16 Apr 2020 14:06:59 +0200 (CEST) Date: Thu, 16 Apr 2020 14:06:59 +0200 From: Jan Kara To: Christoph Hellwig Cc: axboe@kernel.dk, yuyufen@huawei.com, tj@kernel.org, jack@suse.cz, bvanassche@acm.org, tytso@mit.edu, gregkh@linuxfoundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 7/8] bdi: simplify bdi_alloc Message-ID: <20200416120659.GL23739@quack2.suse.cz> References: <20200416071519.807660-1-hch@lst.de> <20200416071519.807660-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200416071519.807660-8-hch@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 16-04-20 09:15:18, Christoph Hellwig wrote: > Merge the _node vs normal version and drop the superflous gfp_t argument. > > Signed-off-by: Christoph Hellwig Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > block/blk-core.c | 2 +- > drivers/mtd/mtdcore.c | 2 +- > fs/super.c | 2 +- > include/linux/backing-dev.h | 6 +----- > mm/backing-dev.c | 7 +++---- > 5 files changed, 7 insertions(+), 12 deletions(-) > > diff --git a/block/blk-core.c b/block/blk-core.c > index 7e4a1da0715e..ab87f2833ab2 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -484,7 +484,7 @@ struct request_queue *__blk_alloc_queue(int node_id) > if (ret) > goto fail_id; > > - q->backing_dev_info = bdi_alloc_node(GFP_KERNEL, node_id); > + q->backing_dev_info = bdi_alloc(node_id); > if (!q->backing_dev_info) > goto fail_split; > > diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c > index 2916674208b3..39ec563d9a14 100644 > --- a/drivers/mtd/mtdcore.c > +++ b/drivers/mtd/mtdcore.c > @@ -2036,7 +2036,7 @@ static struct backing_dev_info * __init mtd_bdi_init(char *name) > struct backing_dev_info *bdi; > int ret; > > - bdi = bdi_alloc(GFP_KERNEL); > + bdi = bdi_alloc(NUMA_NO_NODE); > if (!bdi) > return ERR_PTR(-ENOMEM); > > diff --git a/fs/super.c b/fs/super.c > index cd352530eca9..dd28fcd706ff 100644 > --- a/fs/super.c > +++ b/fs/super.c > @@ -1598,7 +1598,7 @@ int super_setup_bdi_name(struct super_block *sb, char *fmt, ...) > int err; > va_list args; > > - bdi = bdi_alloc(GFP_KERNEL); > + bdi = bdi_alloc(NUMA_NO_NODE); > if (!bdi) > return -ENOMEM; > > diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h > index 4098ed6ba6b4..6b3504bf7a42 100644 > --- a/include/linux/backing-dev.h > +++ b/include/linux/backing-dev.h > @@ -36,11 +36,7 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, > void bdi_set_owner(struct backing_dev_info *bdi, struct device *owner); > void bdi_unregister(struct backing_dev_info *bdi); > > -struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id); > -static inline struct backing_dev_info *bdi_alloc(gfp_t gfp_mask) > -{ > - return bdi_alloc_node(gfp_mask, NUMA_NO_NODE); > -} > +struct backing_dev_info *bdi_alloc(int node_id); > > void wb_start_background_writeback(struct bdi_writeback *wb); > void wb_workfn(struct work_struct *work); > diff --git a/mm/backing-dev.c b/mm/backing-dev.c > index 1ba9a7b30933..119a41650833 100644 > --- a/mm/backing-dev.c > +++ b/mm/backing-dev.c > @@ -865,12 +865,11 @@ static int bdi_init(struct backing_dev_info *bdi) > return ret; > } > > -struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) > +struct backing_dev_info *bdi_alloc(int node_id) > { > struct backing_dev_info *bdi; > > - bdi = kmalloc_node(sizeof(struct backing_dev_info), > - gfp_mask | __GFP_ZERO, node_id); > + bdi = kzalloc_node(sizeof(*bdi), GFP_KERNEL, node_id); > if (!bdi) > return NULL; > > @@ -880,7 +879,7 @@ struct backing_dev_info *bdi_alloc_node(gfp_t gfp_mask, int node_id) > } > return bdi; > } > -EXPORT_SYMBOL(bdi_alloc_node); > +EXPORT_SYMBOL(bdi_alloc); > > static struct rb_node **bdi_lookup_rb_node(u64 id, struct rb_node **parentp) > { > -- > 2.25.1 > -- Jan Kara SUSE Labs, CR