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=-5.2 required=3.0 tests=BAYES_00, 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 21395C433DB for ; Mon, 22 Feb 2021 17:43:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C221964E3F for ; Mon, 22 Feb 2021 17:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C221964E3F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B8E46B0075; Mon, 22 Feb 2021 12:43:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 468C48D0002; Mon, 22 Feb 2021 12:43:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 331138D0001; Mon, 22 Feb 2021 12:43:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id 1E53F6B0075 for ; Mon, 22 Feb 2021 12:43:54 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DF3672494 for ; Mon, 22 Feb 2021 17:43:53 +0000 (UTC) X-FDA: 77846626746.28.2938B05 Received: from outbound-smtp18.blacknight.com (outbound-smtp18.blacknight.com [46.22.139.245]) by imf07.hostedemail.com (Postfix) with ESMTP id 97279A000857 for ; Mon, 22 Feb 2021 17:43:52 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp18.blacknight.com (Postfix) with ESMTPS id 56FDA1C3A64 for ; Mon, 22 Feb 2021 17:43:51 +0000 (GMT) Received: (qmail 29816 invoked from network); 22 Feb 2021 17:43:51 -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); 22 Feb 2021 17:43:51 -0000 Date: Mon, 22 Feb 2021 17:43:49 +0000 From: Mel Gorman To: Chuck Lever Cc: Linux NFS Mailing List , "linux-mm@kvack.org" , "kuba@kernel.org" Subject: Re: [PATCH RFC] SUNRPC: Refresh rq_pages using a bulk page allocator Message-ID: <20210222174349.GJ3697@techsingularity.net> References: <161340498400.7780.962495219428962117.stgit@klimt.1015granger.net> <20210222093505.GG3697@techsingularity.net> <33A16CEA-24CA-447A-AE8C-824771E9B3E1@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <33A16CEA-24CA-447A-AE8C-824771E9B3E1@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Stat-Signature: cqabp6m5mm54gch5idshkmjyc99dpk38 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 97279A000857 Received-SPF: none (techsingularity.net>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=outbound-smtp18.blacknight.com; client-ip=46.22.139.245 X-HE-DKIM-Result: none/none X-HE-Tag: 1614015832-799223 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, Feb 22, 2021 at 02:58:04PM +0000, Chuck Lever wrote: > > There is a conflict at the end where rq_page_end gets updated. The 5.11 > > code assumes that the loop around the allocator definitely gets all > > the required pages. What tree is this patch based on and is it going in > > during this merge window? While the conflict is "trivial" to resolve, > > it would be buggy because on retry, "i" will be pointing to the wrong > > index and pages potentially leak. Rather than guessing, I'd prefer to > > base a series on code you've tested. > > I posted this patch as a proof of concept. There is a clean-up patch > that goes before it to deal properly with rq_page_end. I can post > both if you really want to apply this and play with it. > It's for the best. It doesn't belong in the series as such but it may affect what the bulk allocator usage looks like. > > > The slowpath for the bulk allocator also sucks a bit for the semantics > > required by this caller. As the bulk allocator does not walk the zonelist, > > it can return failures prematurely -- fine for an optimistic bulk allocator > > that can return a subset of pages but not for this caller which really > > wants those pages. The allocator may need NOFAIL-like semantics to walk > > the zonelist if the caller really requires success or at least walk the > > zonelist if the preferred zone is low on pages. This patch would also > > need to preserve the schedule_timeout behaviour so it does not use a lot > > of CPU time retrying allocations in the presense of memory pressure. > > Waiting half a second before trying again seems like overkill, though. > It is both overkill and time is not directly correlated with memory pressure. However, I would also suggest removing the timeout as a separate patch as it's not related to the bulk allocator in case someone does encounter a high CPU usage problem and bisects it the patch using the bulk allocator for the first time. -- Mel Gorman SUSE Labs