Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3079554pxu; Mon, 19 Oct 2020 03:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygDifdH5G+tGDZDHdktff3bLprt1zBEqhY2Wy6SsbaTlr4TIcN6VpDQwRKw+0z4U/jf6Yb X-Received: by 2002:a50:d654:: with SMTP id c20mr17931033edj.54.1603103320307; Mon, 19 Oct 2020 03:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603103320; cv=none; d=google.com; s=arc-20160816; b=g7cMbOhHxUBveet/0qKZhCG5y00MjsWr7pUOOSgtytclio3CzAbXmbX7dvSmC4H2TF NV/JIugEAo24AwW/Av7G0nb53dP5Z3f3YX3ArrGPA+5fpbw/12yqHCEPSUgNWXfI1NfQ SjDicYZzRbuyvmafmRTUO0D42WNtP+FViywVUz6TQoLNujjt+h9R5yPq2Xzbf4tHdfqL i/Zh4mR5bwzOrLv1pg5AONqF3i/C3bQZZZAZW8yQoM9m5EzWWBYAYD24lnUnxlKsOh1+ YlwiODhfNS/p0gbfjNBpEwueAGKGa0apSnH1CD87I5TC/A7RbkyoIbXIcZqAaml2tww8 Obcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=hEdO6TkA7P7PU6c3195WpR2PsTEDAuHv41LHT04lbX8=; b=O1u2O583WDVtaxedCDrBS0wbZ6MOYJ83LRl9FtH20y5d/OQKkkP5+8npqvdvMG1iiG RAGiex9tm/EhYG0/TIH3LIy3zLV+vE/MxbikW3Hz/Y0oruZVLREl7/a3xOSqxZDk53dZ fkuaU056tf6mMVUL8p42Ud+HKZiP8WcPv8OBJemKJfclBgVoZPNIXwsME08Bj04mhuoQ LCv0RZ14seSLbelHeiTPEVKhW/S4EqPLUWlHYaSmmVaz0pOvFpprYIOb5f1H6XNpQj6V 4Cxs5YizfbyJ0qS1QmsD2IsDzycnRpMy0cL1qSobYBNtvIaUYlzZrKBcYmmLoFytKXVf txCA== 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 e21si5848154edy.555.2020.10.19.03.28.17; Mon, 19 Oct 2020 03:28:40 -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 S1729036AbgJSIbL (ORCPT + 99 others); Mon, 19 Oct 2020 04:31:11 -0400 Received: from smtp.h3c.com ([60.191.123.50]:45106 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728871AbgJSIbK (ORCPT ); Mon, 19 Oct 2020 04:31:10 -0400 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam02-ex.h3c.com with ESMTPS id 09J8USuc021549 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 19 Oct 2020 16:30:28 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 19 Oct 2020 16:30:31 +0800 From: Xianting Tian To: , CC: , , , Xianting Tian Subject: [PATCH] blk-mq: remove the calling of local_memory_node() Date: Mon, 19 Oct 2020 16:20:47 +0800 Message-ID: <20201019082047.31113-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP02-EX.srv.huawei-3com.com (10.63.20.133) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 09J8USuc021549 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). Fixes: bffed457160ab ("blk-mq: Avoid memoryless numa node encoded in hctx numa_node") 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