Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2381102pxb; Mon, 20 Sep 2021 20:50:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmIA57/EFJN2PjlYIlWiZ6nsDLogAV+gGtGZpUmT3wVPg3U/9Jl8pmgVT1qgM4mx6bNtH1 X-Received: by 2002:a17:906:c2cf:: with SMTP id ch15mr31942896ejb.107.1632196226161; Mon, 20 Sep 2021 20:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632196226; cv=none; d=google.com; s=arc-20160816; b=rvImnmco7ZJDNXkWVEGkwZnLv8s3/86eZBfCSk/sO6RBSDOTCuwDR40xyCycXDwKvA E1EZZ0m/duK84pabPqttLM0VjIIiaeOhWBk4g+7i1daHybFFp8oSMhpyNurTgMudr4E4 irVXRLp/3/T6VNmuyiL38vxnXEn2RUeOHfd3GwMkt4ax7A99M58PTJ1/z8Dep47wpWWf AA3fxbqjApTtB1BJdjlUJGcL5YpS2Nq8ImWwZQl6eevfjnYw4uQzKV/uvt7PbnfycXto x8rBMZaB1T0LFBi4AGzfPcfaAqiluM6p7VFuJN6Io4E0e+zdH1QILJ5bVDw49j+ZfoBX wl+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=DSbgiXkFC+Y4M1oU9xp1rvgmBone8LNnbtaCTWQdN4s=; b=ZV2RHbJJYLTMV4ZmGKbhoBH6uQfT4kfKcQ6pQief7EKb4CRXPtT6h83u/qo6TGsOq7 tsx3QaSW2jwgIlZDijc9oVIsw0lw2oQjelMoV/vvf+ybTa0eNtikFS9E+o5TxLchLSpn i+aVQFt/whjsKcvxHB/xzN6TlDxYcP1qRZJrLzgUF/PsQ8ITEnOiAamlZTCuZGFSmnSs RlOG/KEeMxRkrUYQkpB3GUoyUlhJWTQn6PZBJPCnvczV7Upl1FMc0Emxgl8kSsDfbD/Z kethEIi8rqUD1Uyywxis+8r4JuWcvmbo1aZpRevGaY7MV1NSzJCMNqC2m2x4HmOIGhk9 /SUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=R0BIAB5T; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd7si16760853ejc.41.2021.09.20.20.50.02; Mon, 20 Sep 2021 20:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=R0BIAB5T; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234845AbhIUAQx (ORCPT + 99 others); Mon, 20 Sep 2021 20:16:53 -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