From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 03C96200C2 for ; Fri, 6 Feb 2026 18:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770403772; cv=none; b=PhcK7M8Guhm1aecsLltxd3vyVvTBIBCi0eu7Fa4p0G2T9ku4oyIqgS1Lvx1DiOQoEoiE2qrIo7C/gv+OnWJ+AadnU92W+91MSFWIB7TvLgOzLfxO3OJqtjw9cWyf+3zaTMfkAAex8eNN2DTM4Y+wKSogbyoCdLlne/4cN2W/JBQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770403772; c=relaxed/simple; bh=Ct/xxlxmhGoUfVEwFGFanTLGcZ0irWlIe/sfdPO2dwo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b9GLFd9u6JgKGJ9MZXUGZhXUhbbfk9HMdxDCqQ+om2hPBAhPF3L3RCM80BWZoAT6gz7iIfohm9DrsEqD4ycHduszJ8ahEadzcgsh83E1cwGCo//NW4LkwaS5C3sGfhEh9C3ktgIFbRivqSO3ACFpNVLRE9jfKq6XHP6E8nA11Cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=hseMd+A4; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hseMd+A4" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=2PnF4DwLH70ap6fHwtiAszTynwFpgDYopGQkueAq9rQ=; b=hseMd+A4NenMekn6TuWNmdQ+e0 4qm76n4cPfr3qAb3TCOs2A6YKC8lEIpsBZlhxcAyJO+gzy233TUpHagOH/WZ0LQZnVDgXJ118/BRr AA+o/DJmDL/i8aCCUrptRs3gCz7XjcBIsT6TcKaEbLIqgaViLgudML9roCSPQXSr48Z2daK7BomCT i5SjDMWHq8FfHt21eLCa9iCDPB/RwHVrTc2qwLYVSc0EcELM4FPJR4aAGrL3h3EnOVqFLy+RULXKi TpW1NpkKwPNnyBc8Hk60IuxW7803WyI7AwKiirubp3WKVA86NqkJko4AwcikUVGJYcpuYXpAjPNaP HgwCS1Nw==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1voQtR-00000005d1T-3eHV; Fri, 06 Feb 2026 18:49:25 +0000 Date: Fri, 6 Feb 2026 18:49:25 +0000 From: Matthew Wilcox To: "David Hildenbrand (Arm)" Cc: xu.xin16@zte.com.cn, akpm@linux-foundation.org, chengming.zhou@linux.dev, hughd@google.com, wang.yaxin@zte.com.cn, yang.yang29@zte.com.cn, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: ksm: initialize rmap values directly and make them const Message-ID: References: <202602061522548871ohgXN8z0qq87sTSX-yZc@zte.com.cn> <5a1cf097-5ab4-41d1-a707-a709de6210cf@kernel.org> <3192eca4-1c90-44ed-8386-bf635db357c4@kernel.org> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3192eca4-1c90-44ed-8386-bf635db357c4@kernel.org> On Fri, Feb 06, 2026 at 07:09:56PM +0100, David Hildenbrand (Arm) wrote: > On 2/6/26 18:34, David Hildenbrand (Arm) wrote: > > On 2/6/26 16:29, Matthew Wilcox wrote: > > > On Fri, Feb 06, 2026 at 03:22:54PM +0800, xu.xin16@zte.com.cn wrote: > > > > make them const to make code more robust. Besides, since KSM > > > > folios are always > > > > order-0, so folio_nr_pages(KSM folio) is always 1, so the line: > > > > > > > >     "pgoff_end = pgoff_start + folio_nr_pages(folio) - 1;" > > > > > > > > becomes directly: > > > > > > > >     "pgoff_end = pgoff_start;" > > > > > > How do you know KSM folios will always be order 0?  I don't.  NAK this > > > change. > > > > Once that changes we can revisit. ACK from me stands. > > And just to elaborate a bit: I don't see support for > 0 happening any time > soon, and it will require significant changes that I am not even sure we > would want to maintain upstream :) OK, you're the KSM maintainer. There doesn't seem to be anywhere else in the KSM code which handles large folios, so this is just removing code that was recently added?