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 25C42C433F5 for ; Thu, 28 Oct 2021 02:04:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A7E3061039 for ; Thu, 28 Oct 2021 02:04:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A7E3061039 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chrisdown.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 20CA16B0071; Wed, 27 Oct 2021 22:04:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19587940007; Wed, 27 Oct 2021 22:04:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 035286B0073; Wed, 27 Oct 2021 22:04:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id C762B6B0071 for ; Wed, 27 Oct 2021 22:04:31 -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 5B5A98249980 for ; Thu, 28 Oct 2021 02:04:31 +0000 (UTC) X-FDA: 78744201942.35.1FBD2DD Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by imf22.hostedemail.com (Postfix) with ESMTP id 01A4B1904 for ; Thu, 28 Oct 2021 02:04:30 +0000 (UTC) Received: by mail-wm1-f45.google.com with SMTP id z11-20020a1c7e0b000000b0030db7b70b6bso7910592wmc.1 for ; Wed, 27 Oct 2021 19:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OSitA3a4YdoD7AVvtO/o5ytce1HdqvvgQyY7x4m623Y=; b=mmf9O/JyqVE44qprYmMNGB3KgytgDnVfCtOffK2ETwkIff5iwuA63uXVFF9fc1CcVV aAOattZGuBHK/u+qPj1f5rqPo884LJ1BMCHq2cpFc7ObzD1mwH0oevizG+xM0tPlRW1E W534UqCvIDA7nR5gucRUoyBPfTVTt2zbdJPCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OSitA3a4YdoD7AVvtO/o5ytce1HdqvvgQyY7x4m623Y=; b=n4hgOo2/ZStWmactuMPcxfOKQG2qy6K9CLvnYMWmeCEpF9iNNWXi4E2nJVv8KKxr4F 06ZGYtV3cHSMVaDGwZvnZexK3e7UqwXlt7hEt2yyct09ln73M4wj2dey+2gzJM7aZbIL 7GuMEv+NyuykSB9aPgbfrK4FvjT5JGtJFzy9+8wW07JwK4abWQvwaw87NZJC3Ua3axVr Zffa+TjpmLq94GvtboiJ1UQr2T7ebXndsjOl2M9PAYZDFEywJu+4+nZmbH7tjAQGqLQH 9GZdk4aBOKHPjhJkWpHgFC/+GymfnEnYbVafRD4aAx02Pd+XhKRmjlEfzboYDS1GbAnl UuKQ== X-Gm-Message-State: AOAM531IXS7L41ZF6iBFwGkjBKDnGlB8Jmql8cETxm+J8UPHwc+V2R+9 5KVdeJhwVmXW2wlj8QarkzGLeg== X-Google-Smtp-Source: ABdhPJz3Grg0PQlE13IjsjxOMWSf+DeGi0+RpvMssd352w2yaCF0NIt1b5uV5UBX3LOKD5LdGqRviQ== X-Received: by 2002:a05:600c:2145:: with SMTP id v5mr1357440wml.182.1635386669578; Wed, 27 Oct 2021 19:04:29 -0700 (PDT) Received: from localhost ([2620:10d:c093:400::5:5833]) by smtp.gmail.com with ESMTPSA id l21sm5068138wms.16.2021.10.27.19.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 19:04:29 -0700 (PDT) Date: Thu, 28 Oct 2021 03:04:28 +0100 From: Chris Down To: Zhaoyang Huang Cc: Michal Hocko , 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; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.3 (987dde4c) (2021-09-10) X-Rspamd-Queue-Id: 01A4B1904 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=chrisdown.name header.s=google header.b="mmf9O/Jy"; spf=pass (imf22.hostedemail.com: domain of chris@chrisdown.name designates 209.85.128.45 as permitted sender) smtp.mailfrom=chris@chrisdown.name; dmarc=pass (policy=none) header.from=chrisdown.name X-Stat-Signature: 9qbguxkh3rhs1ehuhznw6nwt4jeec59r X-Rspamd-Server: rspam06 X-HE-Tag: 1635386670-799119 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: Zhaoyang Huang writes: >On Wed, Oct 27, 2021 at 8:31 PM Michal Hocko wrote: >> >> On Wed 27-10-21 20:05:30, Zhaoyang Huang wrote: >> > On Wed, Oct 27, 2021 at 7:52 PM Michal Hocko wrote: >> > > >> > > 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. >> > Please find below for the search result of '~__GFP_DIRECT_RECLAIM' >> > which shows some drivers and net prefer to behave like that. >> > Furthermore, the allocations are always together with high order. >> >> And what is the _practical_ problem you are seeing or trying to solve? >We do have out of tree code behave like this and want to make the >mechanics more robust It does one no good to use concepts like "robustness" in an unsubstantiated, unmeasured, and unquantified way. Either provide the measurements and tell us why we should care about those measurements, or there's very little to discuss. As it is this is a ten-deep thread where Michal has asked several perfectly reasonable questions and has received only a flimsy pastiche of discussion as a reply. Please provide tangible, hard data with reasons we should care about it. With that said, there's no way we're going to change core mm behaviour based on the whims of poorly behaved out of tree drivers.