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 0D739C433F5 for ; Tue, 21 Sep 2021 00:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC0B761245 for ; Tue, 21 Sep 2021 00:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235379AbhIUAQy (ORCPT ); Mon, 20 Sep 2021 20:16:54 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:48738 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbhIUAOx (ORCPT ); Mon, 20 Sep 2021 20:14:53 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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