Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp737001rwi; Thu, 27 Oct 2022 07:04:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PAud5sE+KSKFr9psThEjWPnlIN1rK1XFj0ZHwktj1Sbf6bDDNRp+DGbddz5fa7sUF6XQU X-Received: by 2002:a63:f206:0:b0:446:eb31:47e0 with SMTP id v6-20020a63f206000000b00446eb3147e0mr43032366pgh.491.1666879495231; Thu, 27 Oct 2022 07:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666879495; cv=none; d=google.com; s=arc-20160816; b=eJL9Xsxm/fue9H7m1Ou47brl4gF7mWP0ToQ79+XAMJ3T1V4fkT85DXFwmiPEYttNh4 2HCtwEpPUq5TyVFJmSjfxy3TUdZq5RT7hnAKUVpYGogB49EPaFzYPngUAOFQ95sNQnkR bDyLa3O9mpw02LyqhA6FIC4mrpVXPOdrRRjE+15QxnDAIaRWoJnBIo0DAzoj4h/Wy81Q 4p7/bQY4uMUtMEkWfS30JA/XJ/IiTLI6mTGYjgiTFHP8PrfABo5R0KovQ3p3qgIL2Zj8 FppcbwYEIT0XMcOKhr5Hlwk29ACzGO024ULuiRFrIxoHuzhIVHgJn9eJmOw97iaKb1KH ljvg== 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=iLNO8fwHXhHPJ6MycKJ73w5HGMLMj9HlWspV0+LyiJY=; b=PfO3h1yZUc/QNNNGz5vVuxF991ZzERwnkXiiz93jVOvzOIMtkWkQTsHWBpztDoVzDZ nGsfpzubPsJ4auofsMudz/YnpAcxMiFmGMAOR7He181nJdNw57YvzAXYXAXE+kWL4RzW A5jgwKf3aTZHGCaiTm8biQBc9irfIqhrjNfn8NOQUEzyBGv1WKBtiQCZb1TfESXauMPC HhC2B6Za/zpbl4DR11ylHZ8yOKMTaU6mPAUOVkQakYTRLU5ChDeU94kPj6kW7chNK8wd JOA4aW2dNXMMVaAjPkaJPQ+QziCvVjDcPdFd/YBVomOYOD16OK95RsveylEA2SJXLgbN fvjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rDEM3ZnG; 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 y15-20020a17090322cf00b001836e510540si1949600plg.114.2022.10.27.07.04.41; Thu, 27 Oct 2022 07:04:55 -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=rDEM3ZnG; 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 S235972AbiJ0NFk (ORCPT + 99 others); Thu, 27 Oct 2022 09:05:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235883AbiJ0NF3 (ORCPT ); Thu, 27 Oct 2022 09:05:29 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734B236864; Thu, 27 Oct 2022 06:05:27 -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 25E1A1F8BD; Thu, 27 Oct 2022 13:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666875925; 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=iLNO8fwHXhHPJ6MycKJ73w5HGMLMj9HlWspV0+LyiJY=; b=rDEM3ZnGroiojMFPrn3cjucEP3ymtmI5jrPZuAxvb5gEMPrn0HIj7PmXKMYgHo1+tO7yE2 6urCMiTAG71A2qFslg+sHC6po5k0B6snagoA3ro5K29S4RuzkKtq0qdXHCrGD7CohRaAAK dRp+4plLctbuWS/EqHucGbLmAfiWebU= 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 EFFFE134CA; Thu, 27 Oct 2022 13:05:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id D90POBSCWmNLXgAAMHmgww (envelope-from ); Thu, 27 Oct 2022 13:05:24 +0000 Date: Thu, 27 Oct 2022 15:05:23 +0200 From: Michal Hocko To: Aneesh Kumar K V Cc: Feng Tang , Andrew Morton , Johannes Weiner , Tejun Heo , Zefan Li , Waiman Long , "Huang, Ying" , "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: <44e485d4-acf5-865d-17fe-13be1c1b430b@linux.ibm.com> <22590f74-ec91-e673-32df-8a04b4ab3931@linux.ibm.com> <5a6c29f9-1154-03af-c22e-55108feb155f@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a6c29f9-1154-03af-c22e-55108feb155f@linux.ibm.com> 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 Thu 27-10-22 15:46:07, Aneesh Kumar K V wrote: > On 10/27/22 2:32 PM, Michal Hocko wrote: > > >> > >> Sorry, I meant MAP_ANONYMOUS | MAP_SHARED. > > > > I am still not sure where you are targeting to be honest. MAP_SHARED or > > MAP_PRIVATE both can have page shared between several vmas. > > > What I was checking was w.r.t demotion and shared pages do we need to > cross-check all the related memory policies? On the page fault side, we don't do that. Yes, because on the page fault we do have an originator and so we can apply some reasonable semantic. For the memory reclaim there is no such originator for a specific page. A completely unrelated context might be reclaiming a page with some mempolicy constrain and you do not have any records who has faulted it in. The fact that we have a memory policy also at the task level makes a completely consistent semantic rather hard if possible at all (e.g. what if different thread are simply bound to a different node because shared memory is prefaulted and local thread mappings will be always local). I do not think shared mappings are very much special in that regards. It is our mempolicy API that allows to specify a policy for vmas as well as tasks and the later makes the semantic for reclaim really awkward. -- Michal Hocko SUSE Labs