From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30D9B326951 for ; Mon, 22 Dec 2025 06:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766383808; cv=none; b=o+wvd5i9WO+MInTCmIOdkZquAPJGEfs1MqebZOpu3uFLVrig7eDDtqaN7Xv3KaO66ik2pK00dfFywJc0rK+KedkGABK+HLJhKO6HWX7n959ggdl41wWbRmSpNcApXgVkc+QTs+t1nEtQzWDFEiedbezmgY9p8SGmCqmaI5CquCM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766383808; c=relaxed/simple; bh=2ZLm6y+vDWz/IlruQLkF1a1UAxU3uOV5Gb4PE6qBNwA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=syS8aILlzb/x7/GlWV63PYLZNLMSLiYg3II7elWcgh9IYjqZT8aMMJd2R0wQ7INWfWSe5I29hZdOO3wzKIL1e5Slx5cijd6gzRx6N6Mt7PwzrIO80OoxD/y76SCLuMdq9H1wRVKkYpJ2k+NXvBY4N0WmfgAS7q9U+4eDHUWZkJE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yybZ+PW2; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yybZ+PW2" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2a0d06cfa93so419225ad.1 for ; Sun, 21 Dec 2025 22:10:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1766383805; x=1766988605; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4d4yIf4cTLhpX8RECsjI9Ii+PJ5wkNjuQ9k20d0TZc4=; b=yybZ+PW2uQU6MJQwtRiooTXlyb4Rd/KQXuFSxfO5dAz7Rm3ljQoylFQj7jQdWb2i+l Dxx7CjISy1DPMXeWYtDgzB8FlbGYmwdv7TnrfIcGi/4P1193oUnvkXGatCHSBkHUulsF vSX+80FnKBXTUwfCJ59idlww7Pjd+P8MuQ9DJbnhns4vUZ/v+SuG8ri4YO/uFBpxZp1i s0Y5Y/JT4k63/LuLov369fL5NW4NpOdQa4VUxZ/H7CQYSiGmLYgdqF5UCVuO8Qq3gii3 ZM3gT03YAvi1395nbRL6hP0r9hRsbe3qJR+ApxlcWtgu5TWK+ECwbVIfn6Tob+kelYFf VXbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766383805; x=1766988605; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4d4yIf4cTLhpX8RECsjI9Ii+PJ5wkNjuQ9k20d0TZc4=; b=PBqbak0aY7KT8CHXW2eCnvygKl9kd/YsNcQQB9+MVh2qGuKTeVBEsa7zH2UHXbpRbp jQacxv/L/fu+E/dcPGBEbb68W5NSOsKjSBI7BqZ4yPP9qT8xu6BbjdW6GXt1I5RDAEX/ iOXPRaryfwLj0y7SfBVHQZg/ak41yVN0paX1IA+TYJJBg5gcn2o6IpWRrIvzXBbASJkD 7KvuviOPALDJShrOfi/aB4RTW7LDerh3i5PdjPfTNeENMBsKckIiPZE/U/JALucGle0K tfr/jHe0txcjRS8SNxwpchGGeiF2qp/MbfpfCE28ehHoC5KjsTI+0jZUtW4kTQTibzMp Q2Gg== X-Forwarded-Encrypted: i=1; AJvYcCVLVVZ/feBDZkA81Pi3QWemDPlwrWCNQ49THrGTtq1BlM+HS2XtseUoYFHcEFc7mhC3qAvd1nC+nNkbJyw=@vger.kernel.org X-Gm-Message-State: AOJu0YyB+ZYE9wByN3zVMwKBMAHtXZcJ0zCR1oZjz+g5wQqkQ0CxwfCt CzzEvh+bhN/AJKAaXORylOGhluwmsGyGc2tb0lOTgBbIkMXQ05vRfEGxPrvHhE4ZwA== X-Gm-Gg: AY/fxX78N/5IVhjX7dkKjB8hAPej/ItNUTaIf3IaeJX8Nl9uQiUjX4q5Gw4bM6/Ngo9 3DH2kA1XkdfmUFziAUR+z9vibshPCLJSrEJ9u3xA5z2QzLSepYcdaVleS3LR1sYaB7ENDJLPpAq /xoBwcO11TWkqM9q+msXSrr9bZMak5UeoAJSdyRv5kbSHwJFMBXcsIQcPIneOUplzYEuLFgEO09 +W7czS1cyqcaP59X7e6LSjEBQEKt+D093h689VkrG1uXVd+KEEFK/u2wxh5H507xVXJ29YzocPZ E8C3le9nkKr1Ifcg82zPKLvq8q7SZ5lH7SLBz9yilUBH0bxYFgwtcNIDXLfmo2YY2DRmTdW5e2v 5TPbrqWR39hntBMiPCOiv2BUY15sJXW7kbB+XgtzyXQ7OXHU6lElwa8VLg1IJX09gH4SvxiNUMB vT+psO7em786BiCrYlm5mLk4LpzRqoJGbu206fnxLrDhcItYEeNVK/ X-Google-Smtp-Source: AGHT+IGJHMHvQ2BiL8kGi+L1NEiyq9evaHsD0bUwM82dYISq+7N3XOj+vRLmNpWXWMhfzBHm5bRjRg== X-Received: by 2002:a17:902:e788:b0:2a0:7fac:c031 with SMTP id d9443c01a7336-2a311806e37mr2693085ad.14.1766383804712; Sun, 21 Dec 2025 22:10:04 -0800 (PST) Received: from google.com (248.132.125.34.bc.googleusercontent.com. [34.125.132.248]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48f30bsm9091090b3a.48.2025.12.21.22.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Dec 2025 22:10:04 -0800 (PST) Date: Mon, 22 Dec 2025 06:09:59 +0000 From: Bing Jiao To: Chen Ridong Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, gourry@gourry.net, longman@redhat.com, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, tj@kernel.org, mkoutny@suse.com, david@kernel.org, zhengqi.arch@bytedance.com, lorenzo.stoakes@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, cgroups@vger.kernel.org Subject: Re: [PATCH v2 2/2] mm/vmscan: check all allowed targets in can_demote() Message-ID: References: <20251220061022.2726028-1-bingjiao@google.com> <20251221233635.3761887-1-bingjiao@google.com> <20251221233635.3761887-3-bingjiao@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Dec 22, 2025 at 10:51:49AM +0800, Chen Ridong wrote: > > > On 2025/12/22 7:36, Bing Jiao wrote: > > -void cpuset_node_filter_allowed(struct cgroup *cgroup, nodemask_t *mask) > > -{ > > - struct cgroup_subsys_state *css; > > - struct cpuset *cs; > > - > > - if (!cpuset_v2()) > > - return; > > - > > - css = cgroup_get_e_css(cgroup, &cpuset_cgrp_subsys); > > - if (!css) > > - return; > > - > > - /* Follows the same assumption in cpuset_node_allowed() */ > > - cs = container_of(css, struct cpuset, css); > > nodes_and(*mask, *mask, cs->effective_mems); > > css_put(css); > > } > > Oh, I see you merged these two functions here. > > However, I think cpuset_get_mem_allowed would be more versatile in general use. > > You can then check whether the returned nodemask intersects with your target mask. In the future, > there may be scenarios where users simply want to retrieve the effective masks directly. > Hi Ridong, thank you for the suggestions. I agree that returning a nodemask would provide greater versatility. I think cpuset_get_mem_allowed_relax() would be a better name, since we do not need the locking and online mem guarantees compared to an similar function cpuset_mems_allowed(). Best, Bing