Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 A07B53002CA for ; Wed, 5 Nov 2025 20:11:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762373514; cv=none; b=fscsXj7omItqhohIizEcjC3uKhpmoxTqxL0guoBDwGagksK9FSwi9HuDqt5MQBLmxDGnGAsPgdFy0tKjUBA1WAF1uElhyjRoqYJUifrBFT6ggXljZRtZrk6jbvkDA1YkKbpO1v7L5g2+XJckowpycEdoelP/aIb32uJGoPWroLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762373514; c=relaxed/simple; bh=NFp/V37n2JlPJmM4Ml3ZxXNzYR6pZ1s9aep17sOBoWc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lDwxiYR7uQted23YJTKGVKfYUSoRqbHqd+rLJgU0XdkJVRuVBTdrPOecaO/SzPbWI4hkTbrQRtZcPmtUNN4kNTFYewvgCiKN8TsRHD1iY0KkfnxVVRon/U9PI4b3Ek/8qEd2sbTNKP4p2Wb6g7toYCDgHZLd85HLf/13lhZFtX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gKQG+fsc; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gKQG+fsc" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-477563e28a3so1849995e9.1 for ; Wed, 05 Nov 2025 12:11:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762373511; x=1762978311; darn=lists.linux.dev; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=TumQxLyft0zt3kRPj4Gvce84mIv/VXDVvsyQGcXgpBE=; b=gKQG+fscUjxvB1mVWBc1xDPuO5tbSI/ORyscDjQzFjE4xiAeXQFe3BkBO1YMN/IVOV ui5qYJpwCJuJN/j49cD0rfNumTkwWXgozcmVLVTzYiabpALxAXbpuvII8CsTPh2Bs2d+ s9JK8mKYDoUywMhnym4kORoadeA7QKzhdoY/5V9hRrje9j4pc+3XCyBxXGzCmV/OlCwT E/bioM6oEzSi6cmcB94nIGuK9Tksr/GqyiMLkgMhXdIfKpfBgAWpOBaLCyG7C8IyuPEi PK86nB6Ys5CEjOA1RC9HTfGl5qJnFABGeSC0w+bY/R5Ht7AXzfNICA1fVQLLTrum5L9T 1xRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762373511; x=1762978311; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TumQxLyft0zt3kRPj4Gvce84mIv/VXDVvsyQGcXgpBE=; b=BqvQbsoG68HNQMDyv4SKn5TzyLgBt91BnHvVgSpV7hzWDJbxvQne6PxfS1R7a8/TwZ 1jBf/Y9A6ThYdtr7Xq36L0ySuGvnvgb4tlkXd/suZfKwIlqWFPYBR0vF9+ty4571RZ8m 7OWg2Nixk/4k9/emDbnKruby1C8WXtFvkL7GtBO8uPWo1Th5cml4m7fVNkzynHsr2XeG RKWI9alFV4FW48VO+Sa7W7Vy64Ve9GZxRdZB2eSCdajeSMiQrieJLt0dQUvbKjMh1TAh XaHvxfd17hRJKTzAiJGtf9hpRwKMTE+qJFmed1N1ZTWaQo4+elBfKTRmP9CCKaa59yIB /x6g== X-Forwarded-Encrypted: i=1; AJvYcCWXUG1h0heSJcY7jQUUCI3Jdoy+EJWw22JH8ykNMILGfShJoZ3EGSo7L1hloVN66Pxkqa0jmQ==@lists.linux.dev X-Gm-Message-State: AOJu0YyhsXtbKbFI4sH4DLpUeJm7QG8R+yDgQlscsgeRjTXUfUDV/+70 NT0UN3P+5u36YlgfLPnszQ6hNvY47zAXpUtk1C98mX7fPH0BcNyhmwDD X-Gm-Gg: ASbGncu2Bu+wEZfdeGpDb1yfyMxPl686olVEFCSQWw7GCKSv6qDVnwsbz0dsSYRPL1Z h4uOdvju3un1P7FHbOcu+2/YOaxgUHflc7SJTBijYxwlSwj0Bocvc0QS5Q8xLneRFhew5WRvoz4 13Ruq7ExLgNwqJ3Alyp0DbEFXpp2vrZdfUOfc8B+kcXvo2ahTN1bmFY5+/K567oepQVg6sxHMtC sfmgeo6iM1sbr1UK2cKynX8UmIhMPc+cUEt64dFZ9TSCbje0mUpPRjw6kojyxa2KhSUCd+ndGbR H+NbLd7L5R54N0FmCcaAK7rwO0qRK2vI6NiKqudq7nmlW1otcOvZYnOCKaWxMKkcQRWDU12sOpH ssJvHhhBZ0cewCLl4RbXGWTXEulrPA2YVhGV/eoC0jWVc4qNgOOSC7nZob/6CeqoFV1KpYxTaWN 1zu/fVTUJe77DgWEs6o/CWEgRtK46cMu1UQA2qZNML5t5aZO6YtbiaBBDUhMMkcQidrcELzSP0t T5jCYI2daOgKzETbTfseo5oeoO3N7A= X-Google-Smtp-Source: AGHT+IGU2uJHKe1jjk7qRSxlMsv3pia9G9MZgIFjxGc/cMqJ0vMZlW4f3Bo9nX4bKGT6SOm0X+42uA== X-Received: by 2002:a05:600c:590e:b0:477:632c:47bc with SMTP id 5b1f17b1804b1-477632c4936mr892375e9.6.1762373510748; Wed, 05 Nov 2025 12:11:50 -0800 (PST) Received: from ?IPV6:2003:d8:2f30:b00:cea9:dee:d607:41d? (p200300d82f300b00cea90deed607041d.dip0.t-ipconnect.de. [2003:d8:2f30:b00:cea9:dee:d607:41d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47755938f45sm51392505e9.4.2025.11.05.12.11.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Nov 2025 12:11:49 -0800 (PST) Message-ID: <7f507cb7-f6aa-4f52-b0b5-8f0f27905122@gmail.com> Date: Wed, 5 Nov 2025 21:11:45 +0100 Precedence: bulk X-Mailing-List: damon@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 02/16] mm: introduce leaf entry type and use to simplify leaf entry logic To: Lorenzo Stoakes , Gregory Price Cc: Matthew Wilcox , Andrew Morton , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Sven Schnelle , Peter Xu , Alexander Viro , Christian Brauner , Jan Kara , Arnd Bergmann , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Muchun Song , Oscar Salvador , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , Axel Rasmussen , Yuanchu Xie , Wei Xu , Kemeng Shi , Kairui Song , Nhat Pham , Baoquan He , Chris Li , SeongJae Park , Jason Gunthorpe , Leon Romanovsky , Xu Xin , Chengming Zhou , Jann Horn , Miaohe Lin , Naoya Horiguchi , Pedro Falcato , Pasha Tatashin , Rik van Riel , Harry Yoo , Hugh Dickins , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, damon@lists.linux.dev References: <2c75a316f1b91a502fad718de9b1bb151aafe717.1762171281.git.lorenzo.stoakes@oracle.com> <373a0e43-c9bf-4b5b-8d39-4f71684ef883@lucifer.local> From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05.11.25 21:05, Lorenzo Stoakes wrote: > On Wed, Nov 05, 2025 at 03:01:00PM -0500, Gregory Price wrote: >> On Wed, Nov 05, 2025 at 07:52:36PM +0000, Lorenzo Stoakes wrote: >>> On Wed, Nov 05, 2025 at 02:25:34PM -0500, Gregory Price wrote: >>>> On Wed, Nov 05, 2025 at 07:06:11PM +0000, Matthew Wilcox wrote: >>> I thought about doing this but it doesn't really work as the type is >>> _abstracted_ from the architecture-specific value, _and_ we use what is >>> currently the swp_type field to identify what this is. >>> >>> So we would lose the architecture-specific information that any 'hardware leaf' >>> entry would require and not be able to reliably identify it without losing bits. >>> >>> Trying to preserve the value _and_ correctly identify it as a present entry >>> would be difficult. >>> >>> And I _really_ didn't want to go on a deep dive through all the architectures to >>> see if we could encode it differently to allow for this. >>> >>> Rather I think it's better to differentiate between s/w + h/w leaf entries. >>> >> >> Reasonable - names are hard, but just about anything will be better than swp_entry. >> >> SWE / sw_entry seems perfectly reasonable. > > I'm not a lover of 'sw' in there it's just... eye-stabby. Is that a word? > > I am quite fond of my suggested soft_leaf_t, softleaf_xxx() We do have soft_dirty. It will get interesting with pte_swp_soft_dirty() :) ptw_softlead_soft_dirty() Well, at least I would understand it.