From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B032C433E6 for ; Tue, 9 Feb 2021 10:31:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DEB5764D9D for ; Tue, 9 Feb 2021 10:31:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEB5764D9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5A8B46B0005; Tue, 9 Feb 2021 05:31:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 57FD46B006C; Tue, 9 Feb 2021 05:31:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4BC4A6B0070; Tue, 9 Feb 2021 05:31:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 2FC416B0005 for ; Tue, 9 Feb 2021 05:31:21 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AAC0E824805A for ; Tue, 9 Feb 2021 10:31:20 +0000 (UTC) X-FDA: 77798362320.27.stem31_340525627606 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 8ECF03D663 for ; Tue, 9 Feb 2021 10:31:20 +0000 (UTC) X-HE-Tag: stem31_340525627606 X-Filterd-Recvd-Size: 3965 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Tue, 9 Feb 2021 10:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612866679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sgD3C97UhFZC9s4wn06Vwgzb0NXoGpd4WUSuY/zq4Jg=; b=PqL26fZ8Y3WQAt4U3F2/B5M8ccMledM7Vm5oG7grJCCKxGSO6CLCoxhlNTiJUTR9hoJboz 7t46Fzx9S/6MEd20v9cqxyUS2VMLQU5eMO8DZFqwu0thFwJy2JR1dO3HijBvzPygTqy7lZ XjioDNxSbltT7mVQbFPydxsalCjIY6Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-hesut35RP6ufkaImScVnVA-1; Tue, 09 Feb 2021 05:31:16 -0500 X-MC-Unique: hesut35RP6ufkaImScVnVA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 21E85107ACE6; Tue, 9 Feb 2021 10:31:15 +0000 (UTC) Received: from carbon (unknown [10.36.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7154B39A65; Tue, 9 Feb 2021 10:31:09 +0000 (UTC) Date: Tue, 9 Feb 2021 11:31:08 +0100 From: Jesper Dangaard Brouer To: Chuck Lever Cc: "mgorman@suse.de" , Linux NFS Mailing List , "linux-mm@kvack.org" , brouer@redhat.com, Mel Gorman Subject: Re: alloc_pages_bulk() Message-ID: <20210209113108.1ca16cfa@carbon> In-Reply-To: References: <2A0C36E7-8CB0-486F-A8DB-463CA28C5C5D@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 8 Feb 2021 17:50:51 +0000 Chuck Lever wrote: > Sorry for resending. I misremembered the linux-mm address. > > > Begin forwarded message: > > > > [ please Cc: me, I'm not subscribed to linux-mm ] > > > > We've been discussing how NFSD can more efficiently refill its > > receive buffers (currently alloc_page() in a loop; see > > net/sunrpc/svc_xprt.c::svc_alloc_arg()). > > It looks like you could also take advantage of bulk free in: svc_free_res_pages() I would like to use the page bulk alloc API here: https://github.com/torvalds/linux/blob/master/net/core/page_pool.c#L201-L209 > > Neil Brown pointed me to this old thread: > > > > https://lore.kernel.org/lkml/20170109163518.6001-1-mgorman@techsingularity.net/ > > > > We see that many of the prerequisites are in v5.11-rc, but > > alloc_page_bulk() is not. I tried forward-porting 4/4 in that > > series, but enough internal APIs have changed since 2017 that > > the patch does not come close to applying and compiling. I forgot that this was never merged. It is sad as Mel showed huge improvement with his work. > > I'm wondering: > > > > a) is there a newer version of that work? > > Mel, why was this work never merged upstream? > > b) if not, does there exist a preferred API in 5.11 for bulk > > page allocation? > > > > Many thanks for any guidance! I have a kernel module that micro-bench the API alloc_pages_bulk() here: https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/mm/bench/page_bench04_bulk.c#L97 -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer