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 8B1E5C433F5 for ; Wed, 27 Oct 2021 11:52:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2332C60F6F for ; Wed, 27 Oct 2021 11:52:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2332C60F6F Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 86919940008; Wed, 27 Oct 2021 07:52:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 81844940007; Wed, 27 Oct 2021 07:52:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E040940008; Wed, 27 Oct 2021 07:52:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 5B8B4940007 for ; Wed, 27 Oct 2021 07:52:14 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0D1208249980 for ; Wed, 27 Oct 2021 11:52:14 +0000 (UTC) X-FDA: 78742054188.35.318B1E1 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf26.hostedemail.com (Postfix) with ESMTP id 5FF8820019DC for ; Wed, 27 Oct 2021 11:52:14 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 5C9D11FD45; Wed, 27 Oct 2021 11:52:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635335532; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OZA4QayrfGUEeoPIVBit6eRMtFYI12/UjxAdPE6yC4Q=; b=oD/xKTG2Diq7WbDJERf2kL7fCfdfrx9a7op0gsVHPtqYIx3AofMr3/+k7yiSuTrQrdPNDG MZ6BwxZAMJTI38oFJvfjLlEXW5uQftuY0+T/WXLpg49i4TMU2Jwij2TzBgm9NV2ocPi+ol RRmnn8FDOmAAzMPsXWQ+eSuIDYreP1I= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EA183A3B87; Wed, 27 Oct 2021 11:52:11 +0000 (UTC) Date: Wed, 27 Oct 2021 13:52:11 +0200 From: Michal Hocko To: Zhaoyang Huang Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Subject: Re: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg Message-ID: References: <1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5FF8820019DC X-Stat-Signature: yse8gnx1xbrky96g9huj53s31e8cqyf7 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b="oD/xKTG2"; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1635335534-27355 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 Wed 27-10-21 17:19:56, Zhaoyang Huang wrote: > On Wed, Oct 27, 2021 at 4:26 PM Michal Hocko wrote: > > > > On Wed 27-10-21 15:46:19, Zhaoyang Huang wrote: > > > On Wed, Oct 27, 2021 at 3:20 PM Michal Hocko wrote: > > > > > > > > On Wed 27-10-21 15:01:50, Huangzhaoyang wrote: > > > > > From: Zhaoyang Huang > > > > > > > > > > For the kswapd only reclaiming, there is no chance to try again on > > > > > this group while direct reclaim has. fix it by judging gfp flag. > > > > > > > > There is no problem description (same as in your last submissions. Have > > > > you looked at the patch submission documentation as recommended > > > > previously?). > > > > > > > > Also this patch doesn't make any sense. Both direct reclaim and kswapd > > > > use a gfp mask which contains __GFP_DIRECT_RECLAIM (see balance_pgdat > > > > for the kswapd part).. > > > ok, but how does the reclaiming try with memcg's min protection on the > > > alloc without __GFP_DIRECT_RECLAIM? > > > > I do not follow. There is no need to protect memcg if the allocation > > request doesn't have __GFP_DIRECT_RECLAIM because that would fail the > > charge if a hard limit is reached, see try_charge_memcg and > > gfpflags_allow_blocking check. > > > > Background reclaim, on the other hand never breaches reclaim protection. > > > > What is the actual problem you want to solve? > Imagine there is an allocation with gfp_mask & ~GFP_DIRECT_RECLAIM and > all processes are under cgroups. Kswapd is the only hope here which > however has a low efficiency of get_scan_count. I would like to have > kswapd work as direct reclaim in 2nd round which will have > protection=memory.min. Do you have an example where this would be a practical problem? Atomic allocations should be rather rare. -- Michal Hocko SUSE Labs