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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 730CAC433EF for ; Thu, 20 Jan 2022 08:24:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 730146B00AB; Thu, 20 Jan 2022 03:24:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DF8B6B00AC; Thu, 20 Jan 2022 03:24:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CE5F6B00AD; Thu, 20 Jan 2022 03:24:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 4A25E6B00AB for ; Thu, 20 Jan 2022 03:24:25 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E272F95C82 for ; Thu, 20 Jan 2022 08:24:24 +0000 (UTC) X-FDA: 79049978448.09.19046A6 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf30.hostedemail.com (Postfix) with ESMTP id 4903980010 for ; Thu, 20 Jan 2022 08:24:24 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id CDB492170E; Thu, 20 Jan 2022 08:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1642667062; 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=9xN1A4lWeBuAThpXk0pGMox/x+1CE4rQvfPoSz5lPBo=; b=DQ1G29y8OoQl93S/EwONlm0kwcF3RB14EvOwLeJ7E8JIqTbV5Klh9zVLgEsmR8WKn9ijEs eektIwbI9bT8KDaDyJ33zSaFxpdPwVLgaGwvjFqSXYwwFMnL4EXFeLvYiEY3C480wYzb5y f39pYmWW5cBr4IQVQN6TwGYHszDZzKc= 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 6FA4CA3B85; Thu, 20 Jan 2022 08:24:19 +0000 (UTC) Date: Thu, 20 Jan 2022 09:24:22 +0100 From: Michal Hocko To: Minchan Kim Cc: Andrew Morton , David Hildenbrand , linux-mm , LKML , Suren Baghdasaryan , John Dias Subject: Re: [RESEND][PATCH v2] mm: don't call lru draining in the nested lru_cache_disable Message-ID: References: <20211230193627.495145-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 4903980010 X-Stat-Signature: cupfyw6nfxgo6qjpt1rkkdxq85po6dma Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=DQ1G29y8; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf30.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-HE-Tag: 1642667064-237420 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 19-01-22 20:25:54, Minchan Kim wrote: > On Wed, Jan 19, 2022 at 10:20:22AM +0100, Michal Hocko wrote: [...] > > What does prevent you from calling lru_cache_{disable,enable} this way > > with the existing implementation? AFAICS calls can be nested just fine. > > Or am I missing something? > > It just increases more IPI calls since we drain the lru cache > both upper layer and lower layer. That's I'd like to avoid > in this patch. Just disable lru cache one time for entire > allocation path. I do not follow. Once you call lru_cache_disable at the higher level then no new pages are going to be added to the pcp caches. At the same time existing caches are flushed so the inner lru_cache_disable will not trigger any new IPIs. -- Michal Hocko SUSE Labs