Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp485306ybl; Thu, 12 Dec 2019 22:54:40 -0800 (PST) X-Google-Smtp-Source: APXvYqxblh25Vehe489mSI+mmAQT/cibGOgXPeL8HhoSVDe+fgoMIrwFIpIKc5FvsXTCodnHeiHU X-Received: by 2002:a05:6830:1e2d:: with SMTP id t13mr13352801otr.128.1576220080729; Thu, 12 Dec 2019 22:54:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576220080; cv=none; d=google.com; s=arc-20160816; b=RTFfmrKKfoutrRqC9EtGHQM4ZqyjBAXdkeKY9DfsIr73eypVabgDaLaRoo1kJnyKPq UZx7qWVlWsq6rYM74mFQAxnb0DZf6b292MDVdgqiVpA1a66HvNYplWs32St2WR+tTHZG bi8MpkICRC3hAWLx8fN+IHlDBlcW/SwY9cq3mkB8tjPkN4tevMABOsBuvSXjzo05d8i8 pBDD+/Divp12hihGWIqRaZyXr6l0ijS+JeWEQ0J56MySViXdy0RD18F8V8vuIwBPVNH9 2WYt8nY0hgcKUeQfq4XMoTVEaFfSccKQtXgBxirygfDOssFPn4W6B6FU0B97gHeRyCAA Xv6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1T7Mqv0EwKoMcLx6xpb1nZ/EVK5+AdBBpWDI3GffX2s=; b=OyDfXiFnKY9pt8nrlz4ZwArT2Fl9xpRNPauUd1Mvq6PVZlyzU3qnEab/wWl/D3ngmZ Ol/E096nWbZin1z3i5/igEcsdwwsQJISOMyo+kgiuEhi94Z5jLwDNr3+nJmBWuShMZwC 6eQ+mQAV25kgjR8aXBYfBy32y5sbDwNxBbdg7P0aex7zxltx3xiUp2uk6aAFGvr+2V+O 8SNlhMepgi4qFRX1JJSKSjJcz7zIi5JdfCXF3+rn3PPRO/8H2LatTT56KAwABBmjAJa5 2VsAb6roHibQeVC287iRv5I9EsC3FZN6KSrbOIlxfHEotlFldgI2wqql8SEUbG7p7m1B RfFQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p28si4946866oth.296.2019.12.12.22.54.28; Thu, 12 Dec 2019 22:54:40 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725924AbfLMGxo (ORCPT + 99 others); Fri, 13 Dec 2019 01:53:44 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:37208 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725385AbfLMGxn (ORCPT ); Fri, 13 Dec 2019 01:53:43 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 72DC6644FC45965F575A; Fri, 13 Dec 2019 14:53:40 +0800 (CST) Received: from [127.0.0.1] (10.74.191.121) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Fri, 13 Dec 2019 14:53:37 +0800 Subject: =?UTF-8?Q?Re:_=e7=ad=94=e5=a4=8d:_[PATCH][v2]_page=5fpool:_handle_p?= =?UTF-8?Q?age_recycle_for_NUMA=5fNO=5fNODE_condition?= To: "Li,Rongqing" , Jesper Dangaard Brouer CC: Saeed Mahameed , "ilias.apalodimas@linaro.org" , "jonathan.lemon@gmail.com" , "netdev@vger.kernel.org" , "mhocko@kernel.org" , "peterz@infradead.org" , Greg Kroah-Hartman , "bhelgaas@google.com" , "linux-kernel@vger.kernel.org" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= References: <1575624767-3343-1-git-send-email-lirongqing@baidu.com> <9fecbff3518d311ec7c3aee9ae0315a73682a4af.camel@mellanox.com> <20191211194933.15b53c11@carbon> <831ed886842c894f7b2ffe83fe34705180a86b3b.camel@mellanox.com> <0a252066-fdc3-a81d-7a36-8f49d2babc01@huawei.com> <20191212111831.2a9f05d3@carbon> <7c555cb1-6beb-240d-08f8-7044b9087fe4@huawei.com> <1d4f10f4c0f1433bae658df8972a904f@baidu.com> From: Yunsheng Lin Message-ID: <079a0315-efea-9221-8538-47decf263684@huawei.com> Date: Fri, 13 Dec 2019 14:53:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1d4f10f4c0f1433bae658df8972a904f@baidu.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.191.121] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/13 14:27, Li,Rongqing wrote: >> >> It is good to allocate the rx page close to both cpu and device, but if >> both goal can not be reached, maybe we choose to allocate page that close >> to cpu? >> > I think it is true > > If it is true, , we can remove pool->p.nid, and replace alloc_pages_node with > alloc_pages in __page_pool_alloc_pages_slow, and change pool_page_reusable as > that page_to_nid(page) is checked with numa_mem_id() > > since alloc_pages hint to use the current node page, and __page_pool_alloc_pages_slow > will be called in NAPI polling often if recycle failed, after some cycle, the page will be from > local memory node. Yes if allocation and recycling are in the same NAPI polling context. As pointed out by Saeed and Ilias, the allocation and recycling seems to may not be happening in the same NAPI polling context, see: "In the current code base if they are only called under NAPI this might be true. On the page_pool skb recycling patches though (yes we'll eventually send those :)) this is called from kfree_skb()." So there may need some additionl attention. > > -Li >