From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58FE4349CE2 for ; Fri, 24 Jul 2026 04:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784866729; cv=none; b=cniKbIXXod18m6B3N/aF5UHLFWL4MmmW/RKp3jeZpm0d53apR9imjBLSnfob/Y5vbIyCrYjvXYtsslIvWqWjPU+z4tTkrFzcYGGSj6RmlKw+N396YfJ3EYJGmoDvXOu2f4oIUP/zt0cyrvIpMveZA3x0VqWA9u9CHC3+JKmR6gE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784866729; c=relaxed/simple; bh=UE+25WkddRSp3wEZS2XqD1LRwn4D1Otx2lFlMryBESc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wd0TZ/femuE/MeoAcTeuYX/HBkZ6ATmEmmeGUf2vGzTI66AENlg2JhICmPyS1Krss5XJBL6/pwij6VqxnTsJFB95rpvRgKxZBNw5c8e44v5t2PkQEhk0XjwWs3k0h/z01Og37DCrxwwr8N23mGoOQoWsVO2IaknxOWzEc+d576U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=dk9VntJM; arc=none smtp.client-ip=91.218.175.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="dk9VntJM" Date: Thu, 23 Jul 2026 21:18:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784866724; h=from:from:reply-to:subject:subject: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=iEgGWeL+yTrVdbZEiIfi87cvm6YPXdswgArk5B9kdpk=; b=dk9VntJMllXGY/FMdSbMLmOHXGaJ5tdm5EZ6K5s2gXFTlUptT+TtQM8NCnJuG4DjvlTSB3 wfRJY+VFZySmpCnZ0LEe8WF26TsE3TCd2b3Op79O2Bm0Qu5RkpdD1ju4uvl7/nCrklqV6F myak+3FNHqp8vyohdJnxiCmZ+rUxG4k= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Ridong Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Andrew Morton , Chris Li , Kairui Song , Muchun Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , David Hildenbrand , Qi Zheng , Lorenzo Stoakes , Axel Rasmussen , Yuanchu Xie , Wei Xu , Davidlohr Bueso , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Song Hu , Ridong Chen Subject: Re: [PATCH -v4 1/2] memcg: move mem_cgroup_swappiness and vm_swappiness to mm/swap.h Message-ID: References: <20260723032434.2016749-1-ridong.chen@linux.dev> <20260723032434.2016749-2-ridong.chen@linux.dev> 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: <20260723032434.2016749-2-ridong.chen@linux.dev> X-Migadu-Flow: FLOW_OUT On Thu, Jul 23, 2026 at 11:24:33AM +0800, Ridong wrote: > From: Ridong Chen > > The per-memcg swappiness knob is v1-only; v2 always uses global > vm_swappiness and ignores the per-cgroup field. > > Both mem_cgroup_swappiness() and vm_swappiness are only used within > mm/ (memcontrol.c, memcontrol-v1.c, vmscan.c), so move them out of the > public include/linux/swap.h into the mm-private mm/swap.h. This keeps > unrelated declarations out of include/linux/swap.h. > > Guard memcg->swappiness with CONFIG_MEMCG_V1 as well, so v2-only > kernels drop the unused field. > > No functional change for v1; v2-only kernels drop the unused field. > > Acked-by: Johannes Weiner > Reviewed-by: Barry Song > Reviewed-by: Song Hu > Signed-off-by: Ridong Chen Acked-by: Shakeel Butt