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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 43693C433C1 for ; Thu, 25 Mar 2021 14:07:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE55661A1D for ; Thu, 25 Mar 2021 14:07:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE55661A1D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 277956B0070; Thu, 25 Mar 2021 10:07:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 227606B0073; Thu, 25 Mar 2021 10:07:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C9266B0074; Thu, 25 Mar 2021 10:07:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id E46416B0070 for ; Thu, 25 Mar 2021 10:07:12 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 984AD32078 for ; Thu, 25 Mar 2021 14:07:12 +0000 (UTC) X-FDA: 77958573504.12.156CF06 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by imf26.hostedemail.com (Postfix) with ESMTP id 58D8B40B8CD5 for ; Thu, 25 Mar 2021 14:07:05 +0000 (UTC) Received: by mail-lf1-f49.google.com with SMTP id o10so2694957lfb.9 for ; Thu, 25 Mar 2021 07:07:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pdIHv4/PD3czenmhqB9tk+MCiZEZtlstx+3pXZSdYn4=; b=F12bWCPR2Sk/Xp80UpS74JjBunFCXBeGVh+ZXV3vONkt0eMBNYFrL/dpr5xerdl9EE i2fyMsvej+qJO5pLJx63a4npSLONUy84IQxRp+1zwrY1UBl5ucLfjWLUZt1ysf6PnQ0M saJ0XzaKxaeg+gAH/wC0vDOvC1b7wrOCGmURVTMW1ebZj/u0LkyOkF01zvXQLcIjyr95 ZKtRuwmHtZ0+1LrWaAeEKPLCeCYjHqOdlc3PYGJuvlCqXSp+44+QhvaMe/nTA6dGtBUo 5XmWXgb4z/0AEQJb212Rbj7z4OXIS1YXKZNOYdjmL/lEw3p8Ww3WIdTX2P+3MMrwh6H4 mjiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pdIHv4/PD3czenmhqB9tk+MCiZEZtlstx+3pXZSdYn4=; b=W2zvfurXpZyPAPW+yt6nBwGjyU9sWdDoTBKUEdUVxh1C7Jj7oNa06DTctqWQ/op6A2 uNVmQ35diYJwUkCVW0NYE4vN2wFAW8Rg+vcNCG2I/D+RAGj9I/4k8DOlhNBF3q+4VufP eckRmT9ssqRQjF9V+AyLilErgffl8Y2NDBshlvextlMXmJa7OpcMZEqaSCsTgiNoXO/M IaBcCEroMNtfUFB7n4trdU332+zxDwwcFhbQfkK0nwucG09O8Uy6XiKSXa5RG2PEwEKZ DNCbk6g9A1pQ4PATlL32RQCDo40fPzIehKPzkzB/HNs0wIheGe47Kkb3BQ/hL6mrUhlc 9h9g== X-Gm-Message-State: AOAM530gnj1mAZItXP4dQO6Sao3jwf+yTrW2kcoEp9TFlYF1bufB+ftv PQmWS9+9AI/v541We4ih0XU= X-Google-Smtp-Source: ABdhPJxuXe7GPMoX2rzQ9o37NfAMuSKZftGbZ2nH6SMWR56QnP9ZM9G8QG3JrpaL5VlbnllG5eee/g== X-Received: by 2002:a19:7d7:: with SMTP id 206mr5283288lfh.98.1616681220353; Thu, 25 Mar 2021 07:07:00 -0700 (PDT) Received: from pc638.lan (h5ef52e3d.seluork.dyn.perspektivbredband.net. [94.245.46.61]) by smtp.gmail.com with ESMTPSA id g5sm771424ljj.21.2021.03.25.07.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:06:59 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 25 Mar 2021 15:06:57 +0100 To: Mel Gorman Cc: Matthew Wilcox , Andrew Morton , Uladzislau Rezki , 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: <20210325140657.GA1908@pc638.lan> References: <20210325114228.27719-1-mgorman@techsingularity.net> <20210325125001.GW1719932@casper.infradead.org> <20210325132556.GS3697@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210325132556.GS3697@techsingularity.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 58D8B40B8CD5 X-Stat-Signature: wrspj4hu6n78fqo58zdqp3hk5ckjc3oz Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mail-lf1-f49.google.com; client-ip=209.85.167.49 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616681225-474628 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 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? -- Vlad Rezki