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.8 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 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 089D6C433EF for ; Tue, 21 Sep 2021 00:13:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 76B1661175 for ; Tue, 21 Sep 2021 00:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 76B1661175 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1693494000A; Mon, 20 Sep 2021 20:13:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0CB97940009; Mon, 20 Sep 2021 20:13:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAD5194000A; Mon, 20 Sep 2021 20:13:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id D73B4940009 for ; Mon, 20 Sep 2021 20:13:26 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7F19D8249980 for ; Tue, 21 Sep 2021 00:13:26 +0000 (UTC) X-FDA: 78609656412.20.3988218 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf19.hostedemail.com (Postfix) with ESMTP id EE5EAB0000AD for ; Tue, 21 Sep 2021 00:13:25 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DC5D0220BD; Tue, 21 Sep 2021 00:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1632183204; h=from:from:reply-to: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=DSbgiXkFC+Y4M1oU9xp1rvgmBone8LNnbtaCTWQdN4s=; b=R0BIAB5TRdPPkGgJusC8jb2FlK3KIuDq0VxZ+ex6xJq3ilAXKOT1YHyBZML6wwIXTZZvjA vgvRt/wVq94mvYlCwIkAVT4S2UHcL3R33GvTYxGwxcyj/6CaU2A/+d0QAS6Y55IvbQX4T4 TmEZT3QppuSANM+YMUbYoJhC8ahGlzA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1632183204; h=from:from:reply-to: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=DSbgiXkFC+Y4M1oU9xp1rvgmBone8LNnbtaCTWQdN4s=; b=2PTuCfQamwKo3aHKonMUxT2xxUcEuj8DpXTzxhRjl5q5bmWCrokk/03O79iXNwRh3fGXht 5b0hSPB4DYuzByDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id EDF6213A77; Tue, 21 Sep 2021 00:13:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id W+9GKqAjSWGieAAAMHmgww (envelope-from ); Tue, 21 Sep 2021 00:13:20 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Mel Gorman" Cc: "Linux-MM" , "Theodore Ts'o" , "Andreas Dilger" , "Darrick J . Wong" , "Matthew Wilcox" , "Michal Hocko" , "Dave Chinner" , "Rik van Riel" , "Vlastimil Babka" , "Johannes Weiner" , "Jonathan Corbet" , "Linux-fsdevel" , "LKML" , "Mel Gorman" Subject: Re: [PATCH 1/5] mm/vmscan: Throttle reclaim until some writeback completes if congested In-reply-to: <20210920085436.20939-2-mgorman@techsingularity.net> References: <20210920085436.20939-1-mgorman@techsingularity.net>, <20210920085436.20939-2-mgorman@techsingularity.net> Date: Tue, 21 Sep 2021 10:13:17 +1000 Message-id: <163218319798.3992.1165186037496786892@noble.neil.brown.name> Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=R0BIAB5T; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=2PTuCfQa; spf=pass (imf19.hostedemail.com: domain of neilb@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=neilb@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: EE5EAB0000AD X-Stat-Signature: t8hwzz63rf41usf7fsd684m4pab9jamg X-HE-Tag: 1632183205-208494 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, 20 Sep 2021, Mel Gorman wrote: > -long wait_iff_congested(int sync, long timeout) > -{ > - long ret; > - unsigned long start = jiffies; > - DEFINE_WAIT(wait); > - wait_queue_head_t *wqh = &congestion_wqh[sync]; > - > - /* > - * If there is no congestion, yield if necessary instead > - * of sleeping on the congestion queue > - */ > - if (atomic_read(&nr_wb_congested[sync]) == 0) { > - cond_resched(); > - > - /* In case we scheduled, work out time remaining */ > - ret = timeout - (jiffies - start); > - if (ret < 0) > - ret = 0; > - > - goto out; > - } > - > - /* Sleep until uncongested or a write happens */ > - prepare_to_wait(wqh, &wait, TASK_UNINTERRUPTIBLE); Uninterruptible wait. .... > +static void > +reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason, > + long timeout) > +{ > + wait_queue_head_t *wqh = &pgdat->reclaim_wait; > + unsigned long start = jiffies; > + long ret; > + DEFINE_WAIT(wait); > + > + atomic_inc(&pgdat->nr_reclaim_throttled); > + WRITE_ONCE(pgdat->nr_reclaim_start, > + node_page_state(pgdat, NR_THROTTLED_WRITTEN)); > + > + prepare_to_wait(wqh, &wait, TASK_INTERRUPTIBLE); Interruptible wait. Why the change? I think these waits really need to be TASK_UNINTERRUPTIBLE. Thanks, NeilBrown