Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp439849pxf; Thu, 25 Mar 2021 07:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0cP2LzNzACUFRRZTpMwzuK9rwR0eRJkZIdZ9lLvc+UX0UkRc1iNgIUVQJaOw5ufQ0PJKW X-Received: by 2002:a17:906:4747:: with SMTP id j7mr9662448ejs.221.1616682490480; Thu, 25 Mar 2021 07:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616682490; cv=none; d=google.com; s=arc-20160816; b=rm6NE/mIcKb4HH0lLE5YoKSo36niuQ0BwJecywCp6Z7ZF1le+mUFsC26zJbGvZan5W g5dxUzmW9MIGC/z+roVFrd/rCd2ppj/kNfUiDjX9Mvn/oMsJ115m4vICPnUfgAsKVyPk s46s8pHlOPUpLjBHrYfTtNiwZBQCQo4g63O9q4G0r6whVBNcEa17XU03DZc7HKgbqz+j yu4sou7AnODbCOtthzMX9BZrqG3kzG2G2Lgr2hoc4eEvucMlUMSVTpGSv1vrf7w5Ko9S KtFuoZOh56D1ZIrNKKa+QaqqcMn+YVsXMlFmWIpM/rblg2jQDQmDI0U/K7jIp4Sm98gX C31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=067zVvoPtcC8OLKDjGSkmXLQr8PmGaUpdl/+5qrsIK8=; b=EkXnynMjJlH2iS/B0Z1O1xcIvU2oH5jgsjQR9yf0xMjNMNpe+UTrNJwOrpBF6Kl5De a2BF3KTHig1oOnas7/C6iPHKbG9fQBKAZsoR9HI3DPn3Zmw/k/ju9ZefUH1JLALXt/oC s5WrmKMuAcPpC6L1WUZtpMPn60pG9xeqkhSaRjuSdrK02NYKPnaf0kxRgppW+KLcVePA t6bellBn9dn9VcSeB4FzafonoUuQLaDd7f5E8kZ7uBTlkMkdwVsgHS1/vEOtDPUt2WXk 7csstR1R5wvXq+e257ZovWHNeazL2OHaB6nXxRAWYQ4QqeUJsJ4zB1VC2401Bkn33fz8 Wf2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 x10si4200729ejw.389.2021.03.25.07.27.35; Thu, 25 Mar 2021 07:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbhCYO1C (ORCPT + 99 others); Thu, 25 Mar 2021 10:27:02 -0400 Received: from outbound-smtp09.blacknight.com ([46.22.139.14]:46901 "EHLO outbound-smtp09.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbhCYO02 (ORCPT ); Thu, 25 Mar 2021 10:26:28 -0400 Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp09.blacknight.com (Postfix) with ESMTPS id 06C521C34BB for ; Thu, 25 Mar 2021 14:26:26 +0000 (GMT) Received: (qmail 8307 invoked from network); 25 Mar 2021 14:26:25 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 25 Mar 2021 14:26:25 -0000 Date: Thu, 25 Mar 2021 14:26:24 +0000 From: Mel Gorman To: Uladzislau Rezki Cc: Matthew Wilcox , Andrew Morton , Chuck Lever , Jesper Dangaard Brouer , Christoph Hellwig , Alexander Duyck , Vlastimil Babka , Ilias Apalodimas , LKML , Linux-Net , Linux-MM , Linux-NFS Subject: Re: [PATCH 0/9 v6] Introduce a bulk order-0 page allocator with two in-tree users Message-ID: <20210325142624.GT3697@techsingularity.net> References: <20210325114228.27719-1-mgorman@techsingularity.net> <20210325125001.GW1719932@casper.infradead.org> <20210325132556.GS3697@techsingularity.net> <20210325140657.GA1908@pc638.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210325140657.GA1908@pc638.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Mar 25, 2021 at 03:06:57PM +0100, Uladzislau Rezki wrote: > > On Thu, Mar 25, 2021 at 12:50:01PM +0000, Matthew Wilcox wrote: > > > On Thu, Mar 25, 2021 at 11:42:19AM +0000, Mel Gorman wrote: > > > > This series introduces a bulk order-0 page allocator with sunrpc and > > > > the network page pool being the first users. The implementation is not > > > > efficient as semantics needed to be ironed out first. If no other semantic > > > > changes are needed, it can be made more efficient. Despite that, this > > > > is a performance-related for users that require multiple pages for an > > > > operation without multiple round-trips to the page allocator. Quoting > > > > the last patch for the high-speed networking use-case > > > > > > > > Kernel XDP stats CPU pps Delta > > > > Baseline XDP-RX CPU total 3,771,046 n/a > > > > List XDP-RX CPU total 3,940,242 +4.49% > > > > Array XDP-RX CPU total 4,249,224 +12.68% > > > > > > > > >From the SUNRPC traces of svc_alloc_arg() > > > > > > > > Single page: 25.007 us per call over 532,571 calls > > > > Bulk list: 6.258 us per call over 517,034 calls > > > > Bulk array: 4.590 us per call over 517,442 calls > > > > > > > > Both potential users in this series are corner cases (NFS and high-speed > > > > networks) so it is unlikely that most users will see any benefit in the > > > > short term. Other potential other users are batch allocations for page > > > > cache readahead, fault around and SLUB allocations when high-order pages > > > > are unavailable. It's unknown how much benefit would be seen by converting > > > > multiple page allocation calls to a single batch or what difference it may > > > > make to headline performance. > > > > > > We have a third user, vmalloc(), with a 16% perf improvement. I know the > > > email says 21% but that includes the 5% improvement from switching to > > > kvmalloc() to allocate area->pages. > > > > > > https://lore.kernel.org/linux-mm/20210323133948.GA10046@pc638.lan/ > > > > > > > That's fairly promising. Assuming the bulk allocator gets merged, it would > > make sense to add vmalloc on top. That's for bringing it to my attention > > because it's far more relevant than my imaginary potential use cases. > > > For the vmalloc we should be able to allocating on a specific NUMA node, > at least the current interface takes it into account. As far as i see > the current interface allocate on a current node: > > static inline unsigned long > alloc_pages_bulk_array(gfp_t gfp, unsigned long nr_pages, struct page **page_array) > { > return __alloc_pages_bulk(gfp, numa_mem_id(), NULL, nr_pages, NULL, page_array); > } > > Or am i missing something? > No, you're not missing anything. Options would be to add a helper similar alloc_pages_node or to directly call __alloc_pages_bulk specifying a node and using GFP_THISNODE. prepare_alloc_pages() should pick the correct zonelist containing only the required node. > -- > Vlad Rezki -- Mel Gorman SUSE Labs