Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp512570lqh; Fri, 31 May 2024 08:07:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8KrmIGYp3bbXFBJXDuteYdEJNB/lBTjoFXD3LCfPqrzogW81dYY2LdQXvtUXPRYm7M/nDmZg1PEkSqLastWkzYE53TNNBanmbNHV/nQ== X-Google-Smtp-Source: AGHT+IH/9ugOX7Mpqb6Y0QCIFZ5tDS/hId71o8lH+7h4/c13zBpJ1mT0mooSPRC0zda/pJwOEMtx X-Received: by 2002:a17:90b:11cf:b0:2b2:c6f8:70b0 with SMTP id 98e67ed59e1d1-2c1dc5765e0mr1896912a91.11.1717168064610; Fri, 31 May 2024 08:07:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717168064; cv=pass; d=google.com; s=arc-20160816; b=HLzk5ZURd0FpeY4zbt3mSQm/kgSKXRE/iflbAX4VE/dAVkDjMATROJz+zOUOWNi38t 28cDS8wiz9SVI9HP9YKc9ARljcEvs0jNDOm7bYje7YIFRjPsi4PqwN3Lwk91Inj2HRT+ FvAYYGtll/ymxoxMUiVm2RQIybi/ktDWaGrrk7MnWpqhft6kqQuU/HCKkmaT895u9WU4 XcZb2xQ72tZAqcEb0Qb0nJiVUSf2G+kT4EdLjyIrlqxHicUlFnguUzo2swXbuNMWOV65 Pyt8TcAsJCqs3LqoVbq9ndyhjySd4OCdl2nFZPe97+PnscGY1eZ8nZ9JHBIWAYGsFY5O ftCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=u5zwpZMHVR1bnt6TvY8B0GWABRR6+xaSJ8yqDctK8F4=; fh=jvpmQ3MnE/RxE3nH6/OalSipKrvpee87pTP7085PTLg=; b=RvoqUttR/LRHgns1h+tlZUfjkzIAwkeE9nqwclmouTCXdAszE9A3g15KhPCzYIc2O2 yANWrQrh4thRz8sZrniWlJnasfYuFCHlupAw/6TknRu3VYoiRu4ky5WDP7sBLXXbpKW2 zsMALbzbidAVFlb8OCLir8pTO56wFhXavgq2jEyh7/nbaa8WyFZvaW9wtH/5CqVyebXd npPwPcR4BgkTg5sw2jowyk1SMNh+Xjpn8PlovwXS7c3snxxqEF7FccBEhQ/Tv7pEYAdY rTewxfjDfY0rT87syBrd9sHkyf/kNgL80uQmgASMO3sq7nPNbEuOdUF+YzAOR3/E7bvB c+Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A8xANrCp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-196983-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196983-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1e381a431si1310426a91.116.2024.05.31.08.07.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 08:07:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196983-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=A8xANrCp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-196983-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196983-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2FEB9B294D0 for ; Fri, 31 May 2024 14:32:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D9B83EA86; Fri, 31 May 2024 14:32:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="A8xANrCp" 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 4BA1739AE3 for ; Fri, 31 May 2024 14:32:10 +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=1717165933; cv=none; b=B63RVQPwlmjoQmfw2zHKfKhicHBwTKsZpH3bFcfb/I2BICPFR6Tpc8Hm6/JDYsx+Y093x2+yIU+D4XZBEMMNRD2o2S6cA5n1g1X3nke7I/zSpd36duA7zBpIeSd14RHTfYPQo6aiAhqdN/e2ifupPNfYpTQFecNFuUrJvwqk3rU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717165933; c=relaxed/simple; bh=psrIQSBuxsSeVyol8DExfg5BylOVoECHrozoAuYqQLo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ks3NEUvjD+IaWeBN0uEDj4NlcgZ0BjDS/RZjagR/10Feub/kkhka27ZKLisLyad3fhYZBSvqR7Lm1YbXZHMNyPXkh+4n9eLeQwGVT0WJ0FeGhdMTcHSw5ZfBr73CvYwtgOE0Q46imJvs4rFVSgGRVkZXaaNJHhaXyyOcT/j9WO8= 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=A8xANrCp; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717165930; 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=u5zwpZMHVR1bnt6TvY8B0GWABRR6+xaSJ8yqDctK8F4=; b=A8xANrCpHL4japjoFD8qznLYMhOqlYGMX8MIzHYo/PD8RwwIFXn/ofUDwAiYq7lrARzDdX KG4kqLtZMAcCKcvMy++1s8z1CH/GqgKQeSijE5hc1yT7XYCNuRB8YTNo/uiBYqy53msrf/ rY/3cJmx4URFW52u7TGGD6dez+412PQ= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-WeBmpxGfOOaIiGz1q-GFeQ-1; Fri, 31 May 2024 10:32:07 -0400 X-MC-Unique: WeBmpxGfOOaIiGz1q-GFeQ-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-35dbf83bb20so1248802f8f.2 for ; Fri, 31 May 2024 07:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717165926; x=1717770726; 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=u5zwpZMHVR1bnt6TvY8B0GWABRR6+xaSJ8yqDctK8F4=; b=CGfTTJPxeDnrfKLTt5g6wlCLbHbY8mtxDyQ0ltpT593mJCj1Debz/8Mqgdn9smD3z/ nHo7Sp0aYd0u7NLOLyBN3DKOOOSrVe39OAWj1TdYrNvi/8Hsv8ZdhrpwhbB01UqE28ci 2gOTxFcwgbRzIgAV6I5ELei7EAT5hjMrAIzMiEVgeW611Hez+rVbWlzeRRSkegQMljlY EtbNPIX4yyEQ5cHYqp/Rc2nLi1KILxj+VQZjTjnkLMHzzKL7LUQT35dk8JikvibumA3f 0JwQSeQXyIEdq5FvBrITgRiKBD2ThUT8el9at27KPjy9HMwRiZrXFpvij9qwdwlMMIDF xBMg== X-Gm-Message-State: AOJu0YyAk77fqsHokkkPuvzeMagFGrzmgOd+dlhUNyYC4sb0v2ohB/RW fMagmkFu080Wr8a5dZmHPWPj86BxOvx9oG+A7gcnr2dOgoKrtsH7C4RFwVF9ZcuuswzGnBmdo3o JoyHZmf+WWOO9uZeNGLxS8gdZqwvh24am0+n4svWm/WfZ2x4gHFASFKNXuReIWg== X-Received: by 2002:adf:cd82:0:b0:354:fa5b:62b3 with SMTP id ffacd0b85a97d-35e0f334af7mr1441325f8f.69.1717165926517; Fri, 31 May 2024 07:32:06 -0700 (PDT) X-Received: by 2002:adf:cd82:0:b0:354:fa5b:62b3 with SMTP id ffacd0b85a97d-35e0f334af7mr1441301f8f.69.1717165926030; Fri, 31 May 2024 07:32:06 -0700 (PDT) Received: from ?IPV6:2003:cb:c717:a000:d4df:4b8f:37d4:59e4? (p200300cbc717a000d4df4b8f37d459e4.dip0.t-ipconnect.de. [2003:cb:c717:a000:d4df:4b8f:37d4:59e4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd064998bsm1977446f8f.91.2024.05.31.07.32.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 May 2024 07:32:05 -0700 (PDT) Message-ID: <345161ac-3b42-48aa-ab3d-3b183316479a@redhat.com> Date: Fri, 31 May 2024 16:32:04 +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 v2 3/6] mm/zsmalloc: use a proper page type To: Matthew Wilcox , Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mike Rapoport , Minchan Kim , Hyeonggon Yoo <42.hyeyoo@gmail.com> References: <20240529111904.2069608-1-david@redhat.com> <20240529111904.2069608-4-david@redhat.com> <20240530050123.GA8400@google.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+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xKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq 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 On 31.05.24 16:27, Matthew Wilcox wrote: > On Thu, May 30, 2024 at 02:01:23PM +0900, Sergey Senozhatsky wrote: >> On (24/05/29 13:19), David Hildenbrand wrote: >>> We won't be able to support 256 KiB base pages, which is acceptable. >> [..] >>> +config HAVE_ZSMALLOC >>> + def_bool y >>> + depends on MMU >>> + depends on PAGE_SIZE_LESS_THAN_256KB # we want <= 64 KiB >> >> Can't really say that I'm happy with this, but if mm-folks are >> fine then okay. > > I have an idea ... > > We use 6 of the bits in the top byte of the page_type to enumerate > a type (ie value 0x80-0xbf) and then the remaining 24 bits are > available. It's actually more efficient: > > $ ./scripts/bloat-o-meter prev.o .build-debian/mm/filemap.o > add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-40 (-40) > Function old new delta > __filemap_add_folio 1102 1098 -4 > filemap_unaccount_folio 455 446 -9 > replace_page_cache_folio 474 447 -27 > Total: Before=41258, After=41218, chg -0.10% > > (that's all from PG_hugetlb) > > before: > 1406: 8b 46 30 mov 0x30(%rsi),%eax > mapcount = atomic_read(&folio->_mapcount) + 1; > 1409: 83 c0 01 add $0x1,%eax > if (mapcount < PAGE_MAPCOUNT_RESERVE + 1) > 140c: 83 f8 81 cmp $0xffffff81,%eax > 140f: 7d 6c jge 147d > 1411: 8b 43 30 mov 0x30(%rbx),%eax > 1414: 25 00 08 00 f0 and $0xf0000800,%eax > 1419: 3d 00 00 00 f0 cmp $0xf0000000,%eax > 141e: 74 4e je 146e > > after: > 1406: 8b 46 30 mov 0x30(%rsi),%eax > mapcount = atomic_read(&folio->_mapcount) + 1; > 1409: 83 c0 01 add $0x1,%eax > if (mapcount < PAGE_MAPCOUNT_RESERVE + 1) > 140c: 83 f8 81 cmp $0xffffff81,%eax > 140f: 7d 63 jge 1474 4> > if (folio_test_hugetlb(folio)) > 1411: 80 7b 33 84 cmpb $0x84,0x33(%rbx) > 1415: 74 4e je 1465 > > so we go from "mov, and, cmp, je" to just "cmpb, je", which must surely > be faster to execute as well as being more compact in the I$ (6 bytes vs 15). > > Anyway, not tested but this is the patch I used to generate the above. > More for comment than application. Right, it's likely very similar to my previous proposal to use 8 bit (uint8_t) for the type. https://lore.kernel.org/all/00ba1dff-7c05-46e8-b0d9-a78ac1cfc198@redhat.com/ I would prefer if we would do that separately; unless someone is able to raise why we care about zram + 256KiB that much right now. (claim: we don't) > > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h > index 5265b3434b9e..4129d04ac812 100644 > --- a/include/linux/page-flags.h > +++ b/include/linux/page-flags.h > @@ -942,24 +942,24 @@ PAGEFLAG_FALSE(HasHWPoisoned, has_hwpoisoned) > * mistaken for a page type value. > */ > > -#define PAGE_TYPE_BASE 0xf0000000 > -/* Reserve 0x0000007f to catch underflows of _mapcount */ > -#define PAGE_MAPCOUNT_RESERVE -128 > -#define PG_buddy 0x00000080 > -#define PG_offline 0x00000100 > -#define PG_table 0x00000200 > -#define PG_guard 0x00000400 > -#define PG_hugetlb 0x00000800 > -#define PG_slab 0x00001000 > - > -#define PageType(page, flag) \ > - ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) > -#define folio_test_type(folio, flag) \ > - ((folio->page.page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) > +/* Reserve 0x0000007f to catch underflows of _mapcount */ > +#define PAGE_MAPCOUNT_RESERVE -128 > + > +#define PG_buddy 0x80 > +#define PG_offline 0x81 > +#define PG_table 0x82 > +#define PG_guard 0x83 > +#define PG_hugetlb 0x84 > +#define PG_slab 0x85 Hoping we can stop calling that PG_ ... -- Cheers, David / dhildenb