Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp882787pxb; Wed, 27 Oct 2021 14:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykraR8vYpJ+zgSor3Xz7Np3cobq2y+qLGIRi+3Mo6O2Kzh9oD6xuBWoyD6LL8iQ8W8GqUV X-Received: by 2002:a17:907:7656:: with SMTP id kj22mr51524ejc.191.1635369884608; Wed, 27 Oct 2021 14:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369884; cv=none; d=google.com; s=arc-20160816; b=sUrt0b8r1bKYqjKpNgP9fGXige3V7Mvj6Wpsr5w0/nLq7O0XTn1Fxxi0fz5/cjnpE5 /CcZfz8j92qPWVqqTvKD1pAmFZAMkC77Utq7P/tcxhhYn9LQRWxVm7PaaiUH2PbByDqj vdu2nvtxo48RLXDdlSbNX5jEUDexpoBmO1WxR1MitHAnIIk4uZc7AcSc259LQiJciXJn 9xyLPe7Jg0UEXbb3b2U4AGUwrFRV5jvhqhwnkknCj+YoeP9vSCeJM1mpjWfT5e75sqVJ Btyg8ciTB9KgU8DubxsySByiyNw+HxnPdATYr+inG20F4uT4k2G4cFar2nmt1h0uCZGU mHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OZA4QayrfGUEeoPIVBit6eRMtFYI12/UjxAdPE6yC4Q=; b=ayMDwqo7P6/sCw40n/UQTKwn4G1+REzSk67MQVtG+ohwYH5Jyy5In+GmP2Mrm+i4IK 4oqMMIuOrvwpJT1hPFpYMTvzFZ5yF5pOW2609l/PZvSpz4ilAQ77bWKmYAWgdhLL4gAN mxw9GZS2IjIufhT7SA33cu/CrhLKFTrlgV1ip0mkBJe33I/9mTx5fe7YA/LLgzZnk0WT 4nWTYgSB/VJ3vMmd9mOZ4eZO1Hh4Ini00XNLh8mNXnhLveeyvVCpFnuqpW2dtxkTSt+A 7nmLEp9G3Tt6S9oXK8Lmtr82RjN2Xu5pB2zOgeadECHHzTLLQ7ydwF15HefAODHMDkGs +spQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="oD/xKTG2"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qb29si1639941ejc.678.2021.10.27.14.24.21; Wed, 27 Oct 2021 14:24:44 -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.com header.s=susede1 header.b="oD/xKTG2"; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239960AbhJ0Lyj (ORCPT + 97 others); Wed, 27 Oct 2021 07:54:39 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:45224 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234994AbhJ0Lyi (ORCPT ); Wed, 27 Oct 2021 07:54:38 -0400 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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