Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp802560rwi; Mon, 31 Oct 2022 07:45:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dfrUjLu0m7/t3NBy9Zey6RVR7dwceRhoxERE30WvM7xnRdCcDIM/v63qlg0qC0stVEeqi X-Received: by 2002:a17:907:7e81:b0:7ad:e144:19e5 with SMTP id qb1-20020a1709077e8100b007ade14419e5mr2276695ejc.51.1667227513848; Mon, 31 Oct 2022 07:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667227513; cv=none; d=google.com; s=arc-20160816; b=ndDtAayIQ3ZgMfP5en2Avz3agH3NTrxxBH8IRsJ/hxk1U/T6DfHrdj7/bLrj7RcaZs PPCE2DSBAdbZGJzXpRqjxC+GEJ6eF57BPXRTw1pa/8LYOpy/1XXJ/vCbufa/hjmnPsyZ S6iS0BVzZyI7NdE6weKTcdjQ1Sqcf2yOkmKzFeu8+nghsWc4CgQtnhrDPw7C0LyBJO/q t210p1WSmWLwJ6C4KfmDTdIgbKPsp31/6mwnuMo/JTcPgtIy3d/ajw6wtIK9C6aP16hB SHM920JGLBKo7Huhrbw9sSK8soNgMV2ugUt0e2wsOKALMe4Xws7TNLpV5v11/IWQR4qA tTGA== 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=wVoDxS6PUHIpxcricZG+zBeWGoABJesgtPBdPuIWxgs=; b=wwGGGlwpejavG9VTdXpFM0CMBq2r/omGxzmieKqBq6WKLW8jyEZZv82eXecUN/FQp/ tgOyasz2huSkjrsXems3M8jahRcOG31ZJExiUupZsYyPdihj7iYxhbnCUsGYzvbDqZJZ grUe9cppwAfytNUti2znqzREMXJ2iem6MCgecC8j5m2J3ixgxDWu/WZlaNaLjjynvze5 gkjtAwh+oR614PwPfpiSgqDoWuB7mUWNQiwx3P/k1GwlU6WsfXkVBLXl+SwnNVYpHul5 c7jYfFJJcsKLic4NLzbXJLZJvZA1nSKt+j2OWIa5LH5hJbX0l4S4mGI00SUvyXJ3lLRl rcYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="ADVD/L1p"; 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 j27-20020a170906279b00b0078d93245e34si5745711ejc.793.2022.10.31.07.44.49; Mon, 31 Oct 2022 07:45:13 -0700 (PDT) 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="ADVD/L1p"; 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 S230486AbiJaOci (ORCPT + 99 others); Mon, 31 Oct 2022 10:32:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiJaOch (ORCPT ); Mon, 31 Oct 2022 10:32:37 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F89A65A6; Mon, 31 Oct 2022 07:32:36 -0700 (PDT) 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-out2.suse.de (Postfix) with ESMTPS id D944E1F893; Mon, 31 Oct 2022 14:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1667226754; 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=wVoDxS6PUHIpxcricZG+zBeWGoABJesgtPBdPuIWxgs=; b=ADVD/L1pGDvFfcekCmppTqkmXcU+rjMdYyhg8mHnsMS8svmtsz6Elc3Var2Zm60DaTjzoz 6VshnsOVVIjhaLCLy9tavEkU8kFcf/5vobuAXe9oB1vvFXbqCdLYKQHoHXV6HPx6Go37d8 /dHwaSMM3TO2m2wVYZeeokpupX5y/hs= 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 BACA213451; Mon, 31 Oct 2022 14:32:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6UZZK4LcX2MhfQAAMHmgww (envelope-from ); Mon, 31 Oct 2022 14:32:34 +0000 Date: Mon, 31 Oct 2022 15:32:34 +0100 From: Michal Hocko To: Feng Tang Cc: "Huang, Ying" , Aneesh Kumar K V , Andrew Morton , Johannes Weiner , Tejun Heo , Zefan Li , Waiman Long , "linux-mm@kvack.org" , "cgroups@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Hansen, Dave" , "Chen, Tim C" , "Yin, Fengwei" Subject: Re: [PATCH] mm/vmscan: respect cpuset policy during page demotion Message-ID: References: <87wn8lkbk5.fsf@yhuang6-desk2.ccr.corp.intel.com> <87o7txk963.fsf@yhuang6-desk2.ccr.corp.intel.com> <87fsf9k3yg.fsf@yhuang6-desk2.ccr.corp.intel.com> <87bkpwkg24.fsf@yhuang6-desk2.ccr.corp.intel.com> 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 Mon 31-10-22 22:09:15, Feng Tang wrote: > On Mon, Oct 31, 2022 at 04:40:15PM +0800, Michal Hocko wrote: > > On Fri 28-10-22 07:22:27, Huang, Ying wrote: > > > Michal Hocko writes: > > > > > > > On Thu 27-10-22 17:31:35, Huang, Ying wrote: > > [...] > > > >> I think that it's possible for different processes have different > > > >> requirements. > > > >> > > > >> - Some processes don't care about where the memory is placed, prefer > > > >> local, then fall back to remote if no free space. > > > >> > > > >> - Some processes want to avoid cross-socket traffic, bind to nodes of > > > >> local socket. > > > >> > > > >> - Some processes want to avoid to use slow memory, bind to fast memory > > > >> node only. > > > > > > > > Yes, I do understand that. Do you have any specific examples in mind? > > > > [...] > > > > > > Sorry, I don't have specific examples. > > > > OK, then let's stop any complicated solution right here then. Let's > > start simple with a per-mm flag to disable demotion of an address space. > > Should there ever be a real demand for a more fine grained solution > > let's go further but I do not think we want a half baked solution > > without real usecases. > > Yes, the concern about the high cost for mempolicy from you and Yang is > valid. > > How about the cpuset part? Cpusets fall into the same bucket as per task mempolicies wrt costs. Geting a cpuset requires knowing all tasks associated with a page. Or am I just missing any magic? And no memcg->cpuset association is not a proper solution at all. > We've got bug reports from different channels > about using cpuset+docker to control meomry placement in memory tiering > system, leading to 2 commits solving them: > > 2685027fca38 ("cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in > cpuset_init_smp()") > https://lore.kernel.org/all/20220419020958.40419-1-feng.tang@intel.com/ > > 8ca1b5a49885 ("mm/page_alloc: detect allocation forbidden by cpuset and > bail out early") > https://lore.kernel.org/all/1632481657-68112-1-git-send-email-feng.tang@intel.com/ > > >From these bug reports, I think it's reasonable to say there are quite > some real world users using cpuset+docker+memory-tiering-system. I don't think anybody is questioning existence of those usecases. The primary question is whether any of them really require any non-trivial (read nodemask aware) demotion policies. In other words do we know of cpuset policy setups where demotion fallbacks are (partially) excluded? -- Michal Hocko SUSE Labs