From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) (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 1FE223A0EA4 for ; Thu, 26 Feb 2026 09:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772098052; cv=none; b=KdLgEbn5wVEqUXqvgywqYThjgN40OLRinDMBPGuJmqOCrokZbJXwNS9TiynJwWghfRbLSWwtY8yymA9TuYmGRwvIdMigmxCofrVvwJNduR4ZCeG3qNWIiQZpQROLJfljqwqEqkiqtGRWl3ZvTZXRXms7s1xxINbV1BojXEaH1yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772098052; c=relaxed/simple; bh=D4V5stBru1OU4bayGW6IrNxDL9B9QxMJFEmTo7pSYwE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ibruHl5zuQTEZiUPoG5hEH/q1tGF1MHMQKEGf47s4SpR7s3pFOzZOfLBA8pv0jKwtHD0nKrFc+bHSuw1e3h3lLXXMNftB5uU8M1fCVIQBmalfqRyBa0lBNaiga+2I0n6sJzmxlABoEyjgLKE/yG3LbtVj7WH8P0lpjOSvJtW38c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=O6GXxoPn; arc=none smtp.client-ip=115.124.30.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="O6GXxoPn" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1772098040; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=5Z7J2/ULNSA00ESGJkV5zPKGTqAvtL1rE4wzbzIL92k=; b=O6GXxoPn6lKiNc4ziEJvv+Ugaf4yysoAXdP9rXx1i17jDk/50TBR3OdryaPssF89n1X1mljwA+HJ6SDZACY4w3qJyyhZYxIcEnhbDK8XiAT8ijFrvWgGtuc9imyRXWeBzfnIUfjYCaIp+vo0e7A/1BDAvE13p8v1HFNdiO4vCGg= Received: from 30.74.144.118(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WzqngAX_1772098037 cluster:ay36) by smtp.aliyun-inc.com; Thu, 26 Feb 2026 17:27:18 +0800 Message-ID: <08a22ed6-3165-41a5-8d46-aaa09402a0f9@linux.alibaba.com> Date: Thu, 26 Feb 2026 17:27:17 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/5] mm: support batched checking of the young flag for MGLRU To: "David Hildenbrand (Arm)" , akpm@linux-foundation.org Cc: catalin.marinas@arm.com, will@kernel.org, lorenzo.stoakes@oracle.com, ryan.roberts@arm.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, riel@surriel.com, harry.yoo@oracle.com, jannh@google.com, willy@infradead.org, baohua@kernel.org, dev.jain@arm.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, hannes@cmpxchg.org, zhengqi.arch@bytedance.com, shakeel.butt@linux.dev, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <84d2426c63c1eafeaa0cfbad7c5cc11e9c11b980.1771897150.git.baolin.wang@linux.alibaba.com> <2e7a1e24-3616-4b79-b943-b5f7efde2d31@kernel.org> <0871edb9-08a2-46a0-ade6-af842a12e0d3@linux.alibaba.com> <2599bc1e-1f8e-46bc-afea-4cb8f657545b@kernel.org> From: Baolin Wang In-Reply-To: <2599bc1e-1f8e-46bc-afea-4cb8f657545b@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/26/26 5:08 PM, David Hildenbrand (Arm) wrote: > >>> >>>> +            pte_t pteval = ptep_get(pvmw.pte); >>> >>> I wonder if there could be a way to avoid this ptep_get() by letting >>> page_vma_mapped_walk() just provide the last value it used (in >>> check_pte() I guess). Something for another patch. >> >> Well, we’d need to add a new field to ‘struct page_vma_mapped_walk’ to >> store the last value (e.g., pvmw.pteval), > > Yes. > >> but this makes me wonder if it >> is worth adding a new field just to avoid a lightweight read (which >> should have no obvious performance impact). > > You recall that ptep_get() on arm64 is not that lightweight due to > con-pte? :) > > But yeah, something for another day. OK. >>> What is "batched"? Did you mean "nr_ptes" ? Or just the initial value >>> for "nr" ? >> >> There is already an 'nr' variable in this function. "nr_ptes" sounds >> good to me, and will use it. > > You can just use "nr" here and reuse it for the existing variable? > > Both have the same semantics (nr of ptes / pages), so having a single > value might cause less confusion. Sure. Will do.