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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 74506C433F5 for ; Wed, 22 Sep 2021 14:13:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5AB10611C9 for ; Wed, 22 Sep 2021 14:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236110AbhIVOOi (ORCPT ); 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