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 EF346C433F5 for ; Wed, 27 Oct 2021 12:31:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9057B60F9D for ; Wed, 27 Oct 2021 12:31:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9057B60F9D 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 ECBDA940008; Wed, 27 Oct 2021 08:31:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E545D940007; Wed, 27 Oct 2021 08:31:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1CD8940008; Wed, 27 Oct 2021 08:31:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0043.hostedemail.com [216.40.44.43]) by kanga.kvack.org (Postfix) with ESMTP id C2ED7940007 for ; Wed, 27 Oct 2021 08:31:03 -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 62EAB31E76 for ; Wed, 27 Oct 2021 12:31:03 +0000 (UTC) X-FDA: 78742152006.10.E8AFD13 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf14.hostedemail.com (Postfix) with ESMTP id AA6B96001E55 for ; Wed, 27 Oct 2021 12:31:03 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 88CC41FD46; Wed, 27 Oct 2021 12:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1635337861; 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=/ZGtK0xOo2bZRtxCSg2rXfX4YA6Rq3MqUKuL+bVoReU=; b=UI5frhLzPfdiR5xuYknfWR+Ixh2SjrSHGdOyajiaPJJjieIWqojZTa7UFWoBrfCROKw5Wh LKKhPBIn/apdHkrGtjlggB8yu63PuGIa1aa+1jDxwV9xE6Xo83ALVUFNo3nKqEabWEeM2z raoQc8T9XHaK8il6SUahiEcpoAExqUw= 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 0BB6DA3B83; Wed, 27 Oct 2021 12:31:01 +0000 (UTC) Date: Wed, 27 Oct 2021 14:31:00 +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-Stat-Signature: n5p1ypkbfzju7q3b7715ie64o1ho8q6m X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: AA6B96001E55 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=UI5frhLz; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf14.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1635337863-550562 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 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? -- Michal Hocko SUSE Labs