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 356C1C433EF for ; Wed, 27 Oct 2021 09:20:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D425060EFE for ; Wed, 27 Oct 2021 09:20:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D425060EFE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 40A81940008; Wed, 27 Oct 2021 05:20:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BB49940007; Wed, 27 Oct 2021 05:20:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28279940008; Wed, 27 Oct 2021 05:20:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id 1575B940007 for ; Wed, 27 Oct 2021 05:20:19 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C68922CFFB for ; Wed, 27 Oct 2021 09:20:18 +0000 (UTC) X-FDA: 78741671316.10.8DA7002 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by imf12.hostedemail.com (Postfix) with ESMTP id 79E0010003C6 for ; Wed, 27 Oct 2021 09:20:18 +0000 (UTC) Received: by mail-qk1-f169.google.com with SMTP id r15so1762970qkp.8 for ; Wed, 27 Oct 2021 02:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TZaeH8xfm8nuJT+C9vZxEFKjeBNQ5Q6FyX6gh6ZxM28=; b=V+YDR1jCCz0mBkrA+c7zBwqLgPoV7OAalEw5gcs5ieHp/pTMOyhSSGYJ61r2zfVXiV 96IDdaO3fCKwr7BNjF25NuC1ZloQxAGwtMUMwtzO8+Ld1uWwj/Or0TgC9Bfk2Hc3rwJQ hL9foVdBOsG9eoSLqxRjhllZRgxEuicl4ygIW+aiHqs62mfurssYmboxGCosK8a/7h6p fN9h6gCfBxOAAdGUDhK74Pc4sa2IkNBFogkD+z6qCTAnzaXb6+jB4+m4g3+zVH+ZGb8P da3/QtzJIr5IQda1kPPBksN8Dzss8mRoMoadmLGxS8nStJcTZ1A01ylAPJqVV32OuDvp GecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TZaeH8xfm8nuJT+C9vZxEFKjeBNQ5Q6FyX6gh6ZxM28=; b=jMIrjpADzuGrUELxyrOt0YgyvCmvReJDhnUPUxUe28UwPkW61JPtcX6j3B1bv0MFXF x01z4tGvrerJ0XHh9hCpRHEaZy5cFeeY4h80m8xa46QPY8QJJRCf3wkw3nOJrcFSbQT5 pLtD/QVXbRQJI28Vfmmo0UHv1VZ2C8iK/VVD5Fp1S6JyYRrO50VmMRCQqggE1YYIkEk+ pMZ/lzkDv11cUvS+xDlMYz9Q5o17HPwWYjtuXDmRiA++3ivKahhWUR3QTaM5P+WdImZS c6nWQzUQbvR2AQmtq5tcNs5phZzydwMCwfXEPF6rCocRsDx5naSOXIuveXdml6hPQLR+ +pnQ== X-Gm-Message-State: AOAM533Jjj58ptBmjmw6tFvdkR1wC+WSNGFBG9vf2XRP7mW8vrRVhoOr ZxArNMXB++PZB9KM/aMDJjJyKgTT7G4O/P9iS2A= X-Google-Smtp-Source: ABdhPJyquDWisQhtsVAixs3S/zN7zvLJhfe8MM1dfhnCwB6V6bSdxaB7WOAp9ZK+jgN7eFZKhXIpF4rbhnvgv3dsPhY= X-Received: by 2002:a05:620a:9d3:: with SMTP id y19mr987133qky.412.1635326417759; Wed, 27 Oct 2021 02:20:17 -0700 (PDT) MIME-Version: 1.0 References: <1635318110-1905-1-git-send-email-huangzhaoyang@gmail.com> In-Reply-To: From: Zhaoyang Huang Date: Wed, 27 Oct 2021 17:19:56 +0800 Message-ID: Subject: Re: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg To: Michal Hocko Cc: Andrew Morton , Johannes Weiner , Vladimir Davydov , Zhaoyang Huang , "open list:MEMORY MANAGEMENT" , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 79E0010003C6 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=V+YDR1jC; spf=pass (imf12.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.222.169 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: q4ow6eqxigks87uphhzms6coi7xpweqb X-Rspamd-Server: rspam06 X-HE-Tag: 1635326418-860836 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, 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. > > -- > Michal Hocko > SUSE Labs