Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp726169rwb; Wed, 14 Dec 2022 01:51:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf5hsp2Yqzm2ss25DOWtxOTWp7xbVSk8RByiM0kb2+UwMV5QSjucbV+KxVx800GvNfgoNIVN X-Received: by 2002:a17:906:3716:b0:7c0:bbab:22e5 with SMTP id d22-20020a170906371600b007c0bbab22e5mr18430497ejc.16.1671011514504; Wed, 14 Dec 2022 01:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671011514; cv=none; d=google.com; s=arc-20160816; b=KinXTHnpiC3AqW2MbjJvLjAwONijL47r/7vRd606Nir6gptjOH5NSyXbCQ9EzqO/QX PacQdsEpIqn9Ob1OFhQGQlBmvTNv1IqrzDeuaN++hrLmzMig2nij6XlTrFrFrikdynhy FiLIJhFo6o8WhJ6h/NRbbD6jLgslnz5E2twMAQQRfhQGLwCcboEAbdtJXwg0lrF8Kd0P kph2yHzzYabjFm8D2+SWZZlQu9i9xfbafUOAJoIZ0SZlOnylYUGKbGEMRlxRFqcanb/F 70Ur9ghzc0hvbnsMDxnbtAOpVWlR3zKG22VeRlv+5LK9igDJRVRHc1VR8yjjGHRG5Gh2 SThw== 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=TSHBBGLgxRKBQUkS4kyHoe7XeZEUdZOiGeNsPiE4bYM=; b=fWvCCnoRGxOxrQNXU/ZS8MixDPqsFpu551jfRFSQcyYdSwWZQl9e9aDD4ge/zxjR0I 4A981bIDeXC+cyQ3at60PJwzVjjLCzoLNHg3WEwBMTCuVp8J1mL5Q+m2QOUIp4lsMKCs XNr2npeCImIz/UIq97cVweqrnhyS7IvhLA8IAkyUXttK9RV3UPfRQaKYlSqTttivQjQD F/JjrEuZBhe4D7/r6Fq4nxl6N7+kvLbexGJBaHzrFQ1H/c/5C1n4NUVpiNb3D9tXt4Tw mzOrObWXQhNtFkcNajwHVDWwlcbi9PNlzy8h3F9xCVXs2MEHuOSOTQhNsC1DAT4ud5PC A1cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=vKKFHJq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr35-20020a1709073fa300b007c122aedb46si11380249ejc.204.2022.12.14.01.51.38; Wed, 14 Dec 2022 01:51:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=vKKFHJq2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237774AbiLNJpQ (ORCPT + 70 others); Wed, 14 Dec 2022 04:45:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237700AbiLNJpE (ORCPT ); Wed, 14 Dec 2022 04:45:04 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039EA55BD for ; Wed, 14 Dec 2022 01:45:03 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8E287220E9; Wed, 14 Dec 2022 09:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1671011102; 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=TSHBBGLgxRKBQUkS4kyHoe7XeZEUdZOiGeNsPiE4bYM=; b=vKKFHJq2c/Q7tXmESWMSFdTZWgMsaREN3rPU1/qtK1r2uP3W4HX8cQ09/MNpje5UWowhE9 hbfwXukmB0NKFDLqfUQBBxDyvnx46LEhdhcZ6aH7QqdeKqIpkvWt+hKLHdxUHhdpj8IExt pnw0Yg7LSpqBvw95RjF6Al4D0guaYws= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 72EB6138F6; Wed, 14 Dec 2022 09:45:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /pYyGR6bmWNVCQAAMHmgww (envelope-from ); Wed, 14 Dec 2022 09:45:02 +0000 Date: Wed, 14 Dec 2022 10:45:01 +0100 From: Michal Hocko To: Dave Hansen Cc: "Huang, Ying" , Yang Shi , Wei Xu , Johannes Weiner , Andrew Morton , linux-mm@kvack.org, LKML Subject: Re: memcg reclaim demotion wrt. isolation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 13-12-22 14:26:42, Dave Hansen wrote: > On 12/13/22 07:41, Michal Hocko wrote: > > This makes sense but I suspect that this wasn't intended also for > > memcg triggered reclaim. This would mean that a memory pressure in one > > hierarchy could trigger paging out pages of a different hierarchy if the > > demotion target is close to full. > > > > I haven't really checked at the current kswapd wake up checks but I > > suspect that kswapd would back off in most cases so this shouldn't > > really cause any big problems. But I guess it would be better to simply > > not wake kswapd up for the memcg reclaim. What do you think? > > You're right that this wasn't really considering memcg-based reclaim. > The entire original idea was that demotion allocations should fail fast, > but it would be nice if they could kick kswapd so they would > *eventually* succeed and just just fail fast forever. > > Before we go trying to patch anything, I'd be really interested what it > does in practice. How much does it actually wake up kswapd? Does > kswapd cause any collateral damage? I haven't seen any real problem so far. I was just trying to wrap my head around consenquences of discussed memory.demote memcg interface [1]. See my reply to Johannes about specific concerns. [1] http://lkml.kernel.org/r/87k02volwe.fsf@yhuang6-desk2.ccr.corp.intel.com -- Michal Hocko SUSE Labs