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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 6AEE8C433EF for ; Tue, 7 Sep 2021 08:17:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 085AF610E9 for ; Tue, 7 Sep 2021 08:17:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 085AF610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 70109900002; Tue, 7 Sep 2021 04:17:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B1A76B0072; Tue, 7 Sep 2021 04:17:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5796C900002; Tue, 7 Sep 2021 04:17:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0090.hostedemail.com [216.40.44.90]) by kanga.kvack.org (Postfix) with ESMTP id 45CF16B0071 for ; Tue, 7 Sep 2021 04:17:23 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E45422A4A4 for ; Tue, 7 Sep 2021 08:17:22 +0000 (UTC) X-FDA: 78560072724.39.006F78D Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf29.hostedemail.com (Postfix) with ESMTP id 6A29990001BC for ; Tue, 7 Sep 2021 08:17:22 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 2349221F35; Tue, 7 Sep 2021 08:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631002641; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=//Mc6TE0EM9syx6GPAn0jwF2If72XRdM9daXKaK/WFc=; b=a2hIrrOXJoUL1yA0fSfj5j8UoDqEa6s2MMLNPh0UR4INF0q2Y+ImwARnRqIFVTzxOWKUIk HnDMnklLNnGSN3KMWXOzsjDTtUPMvrqgTm1Ou/sb8l85IPlDulaFs5GCj2e0zePCPtQxGY p8RzJcatUUE8S2UcgGqwTyaM+7ppFcs= Received: from suse.com (unknown [10.163.43.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 770AFA3B8F; Tue, 7 Sep 2021 08:17:20 +0000 (UTC) Date: Tue, 7 Sep 2021 09:17:18 +0100 From: Mel Gorman To: NeilBrown Cc: Matthew Wilcox , Chuck Lever III , Bruce Fields , Linux NFS Mailing List , Linux-MM Subject: Re: [PATCH] SUNRPC: use congestion_wait() in svc_alloc_args() Message-ID: <20210907081718.GG3828@suse.com> References: <163090344807.19339.10071205771966144716@noble.neil.brown.name> <848A6498-CFF3-4C66-AE83-959F8221E930@oracle.com> <163096695999.2518.10383290668057550257@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <163096695999.2518.10383290668057550257@noble.neil.brown.name> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=a2hIrrOX; spf=pass (imf29.hostedemail.com: domain of mgorman@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mgorman@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6A29990001BC X-Stat-Signature: zimkcw1hsnhs8if55bk37izmj33gd9o9 X-HE-Tag: 1631002642-155233 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 Tue, Sep 07, 2021 at 08:22:39AM +1000, NeilBrown wrote: > On Tue, 07 Sep 2021, Matthew Wilcox wrote: > > On Mon, Sep 06, 2021 at 03:46:34PM +0000, Chuck Lever III wrote: > > > Hi Neil- > > > > > > > On Sep 6, 2021, at 12:44 AM, NeilBrown wrote: > > > > > > > > > > > > Many places that need to wait before retrying a memory allocation use > > > > congestion_wait(). xfs_buf_alloc_pages() is a good example which > > > > follows a similar pattern to that in svc_alloc_args(). > > > > > > > > It make sense to do the same thing in svc_alloc_args(); This will allow > > > > the allocation to be retried sooner if some backing device becomes > > > > non-congested before the timeout. > > > > It's adorable that you believe this is still true. > > always happy to be called "adorable" !! > > > > > https://lore.kernel.org/linux-mm/20191231125908.GD6788@bombadil.infradead.org/ > > > > > Interesting ... a few filesystems call clear_bdi_congested(), but not > enough to make a difference. > > At least my patch won't make things worse. And when (not if !!) > congestion_wait() gets fixed, sunrpc will immediately benefit. > > I suspect that "congestion_wait()" needs to be replaced by several > different interfaces. > > Some callers want to wait until memory might be available, which should > be tracked entirely by MM, not by filesystems. > Other caller are really only interested in their own bdi making progress > and should be allowed to specify that bdi. > For the available memory side, I believe the interface would involve a waitqueue combined with something like struct capture_control except it has a waitqueue, a zone, an order, a struct page pointer and a list_head that is declared on stack. Reclaimers for that zone would check if there are any such waiters and if so, add a page that has just being reclaimed and wake the waiter. That then would be more event driven than time driven which is usually what mm is meant to do. Despite congestion_wait being known to be broken for a long time, I don't recall anyone trying to actually fix it. > And in general, it seems that that waits aren't really interested in > congestion being eased, but in progress being made. > > reclaim_progress_wait() > bdi_progress_wait() > > ?? > > Even if we just provided > > void reclaim_progress_wait(void) > { > schedule_timeout_uninterruptible(HZ/20); > } > reclaim_progress_wait at least would clarify that it's waiting on a page but ultimately, it shouldn't be time based. -- Mel Gorman SUSE Labs