Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp517330pxb; Wed, 22 Sep 2021 07:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDoVjSQ7o4TRV4kVc9EanJABhw0IIv0dzH15vRbwu+K0q75/IC39n+JKFPA+LCE8pUyh1o X-Received: by 2002:a50:d944:: with SMTP id u4mr30233139edj.327.1632320262167; Wed, 22 Sep 2021 07:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632320262; cv=none; d=google.com; s=arc-20160816; b=skbcpVvBDSF9XAQ8oQKEETPsuEQtztrwbDQvWV+1HxgFHBAcsVB7obwykPZxrhYsDW xQgPcj+RA//8Ab72H990Hkb2C9L+1gR5DahHtmm0uVQQ/2d8w1wEgzMo6ut9nWd36f2f POxlSS2xxcd5EB6bF+ajJCzZydkhtC72Md/4oVJ57APwreFNI37wGbmaYA7ithiU7GUz kGzb2EOq6zAtZ2CeXjPBN+pwnQx5GM9mCfOY8OubJ6Ps2U7a+z2jiizmemcQcFkVKyA3 7KGEKaWB9RAxgwNo6jAfjBaXxpEmvAI48cnIobXAN1M3qePELUSEk2sKynnVyUjWgZwV xVow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=qpGAj1cfvpVwrqQO8oiRWSRyURTGTLSPsB/bRG7HssU=; b=kt70EyfP4d/JkTpkoQQq6wFcMMsSz2b36lr2i6oOZjeq3HIv1WQ1Bm3mBISIp9K6Ig fcj9eix5IdxWGOon1r5c+1GVr+LzSVnH9sO6kebB+Qh/alpctYS/A3TlqdpeTBC8T5Zg wr9pB0eNkGUFiu7zVrFLrWPG+/ZLnXZ6LeL82S2/C8HnBMvUbvij5nkO4idRCG318FR/ UGzIsDcqSHOcPqilh3GX+ubfZCG17ELfgz0ruV/TSXlpz10uKBKax9Sy+uV+/89LTtDv G/iKw/mkNHJF+7ExMgDvVIX9z3I9GGVZI4q/5RXBYAkwNpVQh+VwU5lzMGjSjtI1M7Q0 O6KQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si2871504edq.512.2021.09.22.07.17.15; Wed, 22 Sep 2021 07:17:42 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236021AbhIVOOi (ORCPT + 99 others); Wed, 22 Sep 2021 10:14:38 -0400 Received: from outbound-smtp53.blacknight.com ([46.22.136.237]:34933 "EHLO outbound-smtp53.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233005AbhIVOOf (ORCPT ); Wed, 22 Sep 2021 10:14:35 -0400 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp53.blacknight.com (Postfix) with ESMTPS id 3A659FB462 for ; Wed, 22 Sep 2021 15:13:03 +0100 (IST) Received: (qmail 20762 invoked from network); 22 Sep 2021 14:13:03 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 22 Sep 2021 14:13:03 -0000 Date: Wed, 22 Sep 2021 15:13:01 +0100 From: Mel Gorman To: Hillf Danton Cc: Linux-MM , NeilBrown , Dave Chinner , LKML Subject: Re: [PATCH 1/5] mm/vmscan: Throttle reclaim until some writeback completes if congested Message-ID: <20210922141301.GZ3959@techsingularity.net> References: <20210920085436.20939-1-mgorman@techsingularity.net> <20210922121620.4716-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210922121620.4716-1-hdanton@sina.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 08:16:20PM +0800, Hillf Danton wrote: > On Mon, 20 Sep 2021 09:54:32 +0100 Mel Gorman wrote: > > +static void > > +reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason, > > + long timeout) > > +{ > > + wait_queue_head_t *wqh =3D &pgdat->reclaim_wait; > > + unsigned long start =3D 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)); > > Missing wakeup could happen if the current sleeper overwrites > pgdat->nr_reclaim_start set by the existing sleeper. > > if (1 == atomic_inc_and_return(&pgdat->nr_reclaim_throttled)) > WRITE_ONCE(pgdat->nr_reclaim_start, > node_page_state(pgdat, NR_THROTTLED_WRITTEN)); > Good spot, will fix. -- Mel Gorman SUSE Labs