Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4192633pxu; Tue, 20 Oct 2020 10:21:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyDtRG3xmcRTEWeVE7uci3Ojn7gN+H2p6iB+4gGWXcMffpaSQVsmUWKnaMrpnremz3i/w8 X-Received: by 2002:a17:906:940c:: with SMTP id q12mr4328546ejx.195.1603214516480; Tue, 20 Oct 2020 10:21:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603214516; cv=none; d=google.com; s=arc-20160816; b=mIXOXdDJXd4OiEf0sCjPHXTfZrFBqrI6t/TqC7KWTJAocBzImx8SJ8j4+yH6e1m0Qf AhjwSmHXwBFHcZGzwkU3qlAjfcq4N8qEsN/l1aubALtAbpI37PulKKklbZtZOWO4khLK O7u+Qe3OZWF+qaWPaOideHw/3FaJW3tFgZ/i3zpsdvIr+QFxbzwW0uC3hJJbZvhzQUa5 uliIPvoOfCGpeUFQejiC8RTtDBHr+8oGKdyY/WkiKzNXnZg62Icta/umVnqmh3rXH0w4 BKrfQvLOSqioK4mDhAjtkOYXSDN0SmkSfBHDPpnn4scAkQt0wSKcZGEJBq2vyxliB7mz 1MzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=NNJ4GgWME/94x+UDgCCEgtL1/a+JkZcSH4sqxoBQNbM=; b=jEsapiLxMnXDjhTgpE7EH7USv9UfJgmDIBX6/Q7C9iQWc1ODNLsZxHGJyqx08EuLH9 ykNXqFe/CDgWbKa2HrLUzKrZG5p/UKuM4jn8Ca6kSgy0PsoIDfAnnfLScoKOhrRU2LMt StfhE2ntFS+t+QBYUFtMwToGYMJG815VmEl/A+yKJTnHOOECYaLwFPQXhFqi/hetnM6q gfgr1HN8kpN0zJgk0BnSCkSvE3oA9W+JuAPhUSnEpbo+2jpZvi84DEyDpxyyyjjG3AjD OJ7EyCmgmdB+fq6bZRvMddIH0R2wxesl0G84dgJPX+s2XLUi5IU9YvnK8Svgj8jgupqG R/nA== 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 e24si1551319edc.488.2020.10.20.10.21.33; Tue, 20 Oct 2020 10:21:56 -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 S2390878AbgJTCxZ convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Oct 2020 22:53:25 -0400 Received: from smtp.h3c.com ([60.191.123.56]:17530 "EHLO h3cspam01-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390804AbgJTCxZ (ORCPT ); Mon, 19 Oct 2020 22:53:25 -0400 Received: from DAG2EX09-IDC.srv.huawei-3com.com ([10.8.0.72]) by h3cspam01-ex.h3c.com with ESMTPS id 09K2qjIx075291 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 20 Oct 2020 10:52:45 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) by DAG2EX09-IDC.srv.huawei-3com.com (10.8.0.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 20 Oct 2020 10:52:46 +0800 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074]) by DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074%7]) with mapi id 15.01.2106.002; Tue, 20 Oct 2020 10:52:46 +0800 From: Tianxianting To: Michal Hocko CC: "axboe@kernel.dk" , "raghavendra.kt@linux.vnet.ibm.com" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] blk-mq: remove the calling of local_memory_node() Thread-Topic: [PATCH] blk-mq: remove the calling of local_memory_node() Thread-Index: AQHWpfIblb4hxO1wEUaIIqHsdHbO2qmeRzOAgAGEP4A= Date: Tue, 20 Oct 2020 02:52:46 +0000 Message-ID: References: <20201019082047.31113-1-tian.xianting@h3c.com> <20201019114011.GE27114@dhcp22.suse.cz> In-Reply-To: <20201019114011.GE27114@dhcp22.suse.cz> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.99.141.128] x-sender-location: DAG2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-DNSRBL: X-MAIL: h3cspam01-ex.h3c.com 09K2qjIx075291 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Michal, Hi, raghavendra, Jens Could you help comment this issue? Thanks in advance. -----Original Message----- From: Michal Hocko [mailto:mhocko@suse.com] Sent: Monday, October 19, 2020 7:40 PM To: tianxianting (RD) Cc: axboe@kernel.dk; raghavendra.kt@linux.vnet.ibm.com; linux-block@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] blk-mq: remove the calling of local_memory_node() On Mon 19-10-20 16:20:47, Xianting Tian wrote: > We don't need to check whether the node is memoryless numa node before > calling allocator interface. SLUB(and SLAB,SLOB) relies on the page > allocator to pick a node. Page allocator should deal with memoryless > nodes just fine. It has zonelists constructed for each possible nodes. > And it will automatically fall back into a node which is closest to > the requested node. As long as __GFP_THISNODE is not enforced of course. > > The code comments of kmem_cache_alloc_node() of SLAB also showed this: > * Fallback to other node is possible if __GFP_THISNODE is not set. > > blk-mq code doesn't set __GFP_THISNODE, so we can remove the calling > of local_memory_node(). yes, this is indeed the case. I cannot really judge the blg-mq code but it seems to be unnecessary. Maybe there are some subtle details not explained by bffed457160ab though. > Fixes: bffed457160ab ("blk-mq: Avoid memoryless numa node encoded in > hctx numa_node") But the existing code is not broken. It just overdoes what needs to be done. So effectively bffed457160ab was not needed. I do not think that Fixes is really necessary. > Signed-off-by: Xianting Tian > --- > block/blk-mq-cpumap.c | 2 +- > block/blk-mq.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c index > 0157f2b34..3db84d319 100644 > --- a/block/blk-mq-cpumap.c > +++ b/block/blk-mq-cpumap.c > @@ -89,7 +89,7 @@ int blk_mq_hw_queue_to_node(struct blk_mq_queue_map > *qmap, unsigned int index) > > for_each_possible_cpu(i) { > if (index == qmap->mq_map[i]) > - return local_memory_node(cpu_to_node(i)); > + return cpu_to_node(i); > } > > return NUMA_NO_NODE; > diff --git a/block/blk-mq.c b/block/blk-mq.c index > cdced4aca..48f8366b2 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -2737,7 +2737,7 @@ static void blk_mq_init_cpu_queues(struct request_queue *q, > for (j = 0; j < set->nr_maps; j++) { > hctx = blk_mq_map_queue_type(q, j, i); > if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE) > - hctx->numa_node = local_memory_node(cpu_to_node(i)); > + hctx->numa_node = cpu_to_node(i); > } > } > } > -- > 2.17.1 -- Michal Hocko SUSE Labs