From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 22A191CF8A for ; Wed, 17 Jul 2024 08:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721203379; cv=none; b=fke4UDZ155EBexXpw4jQ/d3Nz2HOZRyK4aRwYMe4K4Vabw3gmA0AI9gr5wUFWhT9RzbxCE5FNj/nOE1X7r3F7pSr+3GWQPgsq6/ygOM8XbaQQ7y0Y95fLg68jjMPx+lQUW5TDNBNgv2TSX0puUH10gapRUjgeCgtVSF+mbnY5bA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721203379; c=relaxed/simple; bh=vi40Sbk07TGfblu1VxNt/6IK8WmdfFsGUe5zQV85g0A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Uc8XEgRnGOoi7+E8GDzh0LON4s1Aq2Y7GNjqosCPQx1u4KK4y2Z9S8tasuYkH/MVzvXd0UnE0q5vXX1n5j/7ioyT1dIaVh4eD4wXF9ZozgmHHW8iUoNgt3cp36wG6jk021ZrugtnfLWRAJdLZ1sAKpPHQknCqg0a52aVMMpyccs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=W7UI6SfX; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="W7UI6SfX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721203377; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=aac7mzpK+9VXNPOJ21/RuM77jIgKwx0OrsOzYAH/KZE=; b=W7UI6SfX1a4U3r1JgBRWWMRUQbSH/zWiw5YIMyJUdViHB3GTYMZ8U23nxv4pLmwa1poEuw 8EBECl7cb+SItuPDbTkkafISUsvIczTli6/dMa4NoDGtLfYi5zXioIHYHMJUnVHOm0Ab35 XO9T8oIXxoM2bDuC7BG8rcgLQenZwQI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-49-Ou79gpUBOa6tzHc78voFQQ-1; Wed, 17 Jul 2024 04:02:52 -0400 X-MC-Unique: Ou79gpUBOa6tzHc78voFQQ-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-367a064472aso4379193f8f.1 for ; Wed, 17 Jul 2024 01:02:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721203371; x=1721808171; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=aac7mzpK+9VXNPOJ21/RuM77jIgKwx0OrsOzYAH/KZE=; b=v+VFuOQt1ZYy81UclL0NqMuh6Ad8fnBo9VQog9sQ6bH9gBraeXMJKdTJUpFqNhwgpl iHkOAl4P9cmj0f8dJb6xjnpsGPQh4PnNPXrbizK+EgaYHerb/FMEg7PEmKgXmBzAsgOi PL6HEsyoBkNfSIicKJ5qnlFA0KEoxqgTIdv1cjEmVhmNl1nj/Cy1rVxqgk7jFHY+SZkQ PX/XcPT/IsuzyvqahMemamErQRqn7Cm/feR7FmefBp89Nck0auVyq4HnSheab0uVUXEi WVEdQUA+GxTCr456iRwD2TxvYYavOETHIOfcnY+PDm73qEpoq/cdag7QRWfk3P4wqwL3 go2Q== X-Forwarded-Encrypted: i=1; AJvYcCXJzDzsfc0uWivrObUs6t82uFBguG/AfzZkUSheA1Zu6CsGNvehobKE1iT8D/E3wWlh5l3FGL3mZoRal/7XnDpFdRSh2VDimmJ++jfQ X-Gm-Message-State: AOJu0YzM9umwYAOfHypeEt0cr9kwbZiZ10iYovvN3N2i+OLRf/lo8xYO WuepqzYp/sAPgilCnNlfI9xvcIARMCjstr9HXNKL+7kKpj7U4r9qafSUlxFnOcHkaRDl7SLKyJ+ lrx13+yVQnijmdMtOoTluckl3XAwggdv4MQ23qF656b30yus3K2OozI5X+/Q8Jw== X-Received: by 2002:a05:6000:18af:b0:367:f0d6:24e8 with SMTP id ffacd0b85a97d-368317376c4mr788188f8f.48.1721203371303; Wed, 17 Jul 2024 01:02:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN5AtRZ4oICUJhKNgwLRtPqRrzAQGZwq+PhKjrttjnkY/yb3mUrW+vX7UqqlDhr8rd5hXdpg== X-Received: by 2002:a05:6000:18af:b0:367:f0d6:24e8 with SMTP id ffacd0b85a97d-368317376c4mr788167f8f.48.1721203370846; Wed, 17 Jul 2024 01:02:50 -0700 (PDT) Received: from [192.168.3.141] (p4ff23ef9.dip0.t-ipconnect.de. [79.242.62.249]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3683edc42ebsm182262f8f.90.2024.07.17.01.02.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Jul 2024 01:02:50 -0700 (PDT) Message-ID: <9052f430-2c5a-4d9d-b54c-bd093b797702@redhat.com> Date: Wed, 17 Jul 2024 10:02:48 +0200 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 v1 2/2] mm: mTHP stats for pagecache folio allocations To: Ryan Roberts , Lance Yang , Baolin Wang Cc: Andrew Morton , Hugh Dickins , Jonathan Corbet , "Matthew Wilcox (Oracle)" , Barry Song , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240711072929.3590000-1-ryan.roberts@arm.com> <20240711072929.3590000-3-ryan.roberts@arm.com> <9e0d84e5-2319-4425-9760-2c6bb23fc390@linux.alibaba.com> <756c359e-bb8f-481e-a33f-163c729afa31@redhat.com> <8c32a2fc-252d-406b-9fec-ce5bab0829df@arm.com> <5c58d9ea-8490-4ae6-b7bf-be816dab3356@redhat.com> From: David Hildenbrand Content-Language: en-US Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4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kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit >> Sorry, busy with other stuff. >> >> Indicating only what really exists sounds cleaner. But I wonder how we would >> want to handle in general orders that are effectively non-existant? > > I'm not following your distinction between orders that don't "really exist" and > orders that are "effectively non-existant". I'm questioning whether there should be a distinction at all. We should just hide what is either non-existant (not implemented) or non-functional. > > I guess the real supported orders are: > > anon: > min order: 2 > max order: PMD_ORDER > anon-shmem: > min order: 1 > max order: MAX_PAGECACHE_ORDER > tmpfs-shmem: > min order: PMD_ORDER <= 11 ? PMD_ORDER : NONE > max order: PMD_ORDER <= 11 ? PMD_ORDER : NONE > file: > min order: 1 > max order: MAX_PAGECACHE_ORDER That's my understanding. But not sure about anon-shmem really supporting order-1, maybe we do. > > But today, controls and stats are exposed for: > > anon: > min order: 2 > max order: PMD_ORDER > anon-shmem: > min order: 2 > max order: PMD_ORDER > tmpfs-shmem: > min order: PMD_ORDER > max order: PMD_ORDER > file: > min order: Nothing yet (this patch proposes 1) > max order: Nothing yet (this patch proposes MAX_PAGECACHE_ORDER) > > So I think there is definitely a bug for shmem where the minimum order control > should be order-1 but its currently order-2. Maybe, did not play with that yet. Likely order-1 will work. (although probably of questionable use :) ) > > I also wonder about PUD-order for DAX? We don't currently have a stat/control. > If we wanted to add it in future, if we take the "expose all stats/controls for > all orders" approach, we would end up extending all the way to PUD-order and all > the orders between PMD and PUD would be dummy for all memory types. That really > starts to feel odd, so I still favour only populating what's really supported. I would go further and say that calling the fsdax thing a THP is borderline wrong and we should not expose any new toggles for it that way. It really behaves much more like hugetlb folios that can be PTE-mapped ... we cannot split these things, and they are not allocated from the buddy. So I wouldn't worry about fsdax for now. fsdax support for compound pages (now large folios) probably never should have been glued to any THP toggle. > > I propose to fix shmem (extend down to 1, stop at MAX_PAGECACHE_ORDER) and > continue with the approach of "indicating only what really exists" for v2. > > Shout if you disagree. Makes sense. -- Cheers, David / dhildenb