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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07ABCC433F5 for ; Thu, 14 Oct 2021 15:45:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9F78860FDC for ; Thu, 14 Oct 2021 15:45:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F78860FDC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 40C64900004; Thu, 14 Oct 2021 11:45:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BB91900002; Thu, 14 Oct 2021 11:45:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25C3A900004; Thu, 14 Oct 2021 11:45:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 178CE900002 for ; Thu, 14 Oct 2021 11:45:20 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B36082D01B for ; Thu, 14 Oct 2021 15:45:19 +0000 (UTC) X-FDA: 78695467158.37.3EA29FC Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf15.hostedemail.com (Postfix) with ESMTP id 7B3B6D000096 for ; Thu, 14 Oct 2021 15:45:18 +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-out2.suse.de (Postfix) with ESMTPS id 3CAA41FD3A; Thu, 14 Oct 2021 15:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634226318; 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=Xlba8fQlLTV+uf/QFNHdvELwK8agBCfU4HJu/918Gg8=; b=PUmxe7JODhvk617rHZJOz6J0mOpqx82GVdbwTSvLRDl2C9tHOK3ag1uG8ee9W5Sgn4HlwO D5Aj1we+h8PYc1Ce46L/fOjYBZfBDzld/geTplXqV7DdNgP2uwQdbpZhDTdNcp8ECT0TXJ JHI+QNX6MznhQ0FYu+LOI2ObSEUKfKo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634226318; 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=Xlba8fQlLTV+uf/QFNHdvELwK8agBCfU4HJu/918Gg8=; b=lKB5WgO9+rvi5JqCXTvPW2zGQWlbRr9VQQKOzZpEHUsht0Bd9cR60mMgCn9WjItADyRJ96 oGqbSC29tT69nHDA== 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 0DE0A13D9F; Thu, 14 Oct 2021 15:45:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PFOvAo5QaGEXIwAAMHmgww (envelope-from ); Thu, 14 Oct 2021 15:45:18 +0000 Message-ID: <8420753a-1ae0-17ed-f486-c4ae42b040e0@suse.cz> Date: Thu, 14 Oct 2021 17:45:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 3/8] mm/vmscan: Throttle reclaim when no progress is being made Content-Language: en-US To: Mel Gorman Cc: Linux-MM , NeilBrown , Theodore Ts'o , Andreas Dilger , "Darrick J . Wong" , Matthew Wilcox , Michal Hocko , Dave Chinner , Rik van Riel , Johannes Weiner , Jonathan Corbet , Linux-fsdevel , LKML References: <20211008135332.19567-1-mgorman@techsingularity.net> <20211008135332.19567-4-mgorman@techsingularity.net> <63336163-e709-65de-6d53-8764facd3924@suse.cz> <20211014130312.GA3959@techsingularity.net> From: Vlastimil Babka In-Reply-To: <20211014130312.GA3959@techsingularity.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7B3B6D000096 X-Stat-Signature: gnx7rtcz7mq8zyn6adhwgziibxstr39o Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=PUmxe7JO; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=lKB5WgO9; dmarc=none; spf=pass (imf15.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspamd-Server: rspam02 X-HE-Tag: 1634226318-223923 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 10/14/21 15:03, Mel Gorman wrote: > On Thu, Oct 14, 2021 at 02:31:17PM +0200, Vlastimil Babka wrote: >> On 10/8/21 15:53, Mel Gorman wrote: >> > Memcg reclaim throttles on congestion if no reclaim progress is made. >> > This makes little sense, it might be due to writeback or a host of >> > other factors. >> > >> > For !memcg reclaim, it's messy. Direct reclaim primarily is throttled >> > in the page allocator if it is failing to make progress. Kswapd >> > throttles if too many pages are under writeback and marked for >> > immediate reclaim. >> > >> > This patch explicitly throttles if reclaim is failing to make progress. >> > >> > Signed-off-by: Mel Gorman >> ... >> > @@ -3769,6 +3797,16 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, >> > trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed); >> > set_task_reclaim_state(current, NULL); >> > >> > + if (!nr_reclaimed) { >> > + struct zoneref *z; >> > + pg_data_t *pgdat; >> > + >> > + z = first_zones_zonelist(zonelist, sc.reclaim_idx, sc.nodemask); >> > + pgdat = zonelist_zone(z)->zone_pgdat; >> > + >> > + reclaim_throttle(pgdat, VMSCAN_THROTTLE_NOPROGRESS, HZ/10); >> > + } >> >> Is this necessary? AFAICS here we just returned from: >> >> do_try_to_free_pages() >> shrink_zones() >> for_each_zone()... >> consider_reclaim_throttle() >> >> Which already throttles when needed and using the appropriate pgdat, while >> here we have to somewhat awkwardly assume the preferred one. >> > > Yes, you're right, consider_reclaim_throttle not only throttles on the > appropriate pgdat but takes priority into account. > > Well spotted! So with that part removed Acked-by: Vlastimil Babka Thanks!