Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp238766lqa; Fri, 26 Apr 2024 23:51:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXotEH03veFgUu9FhLmaTUMCT6a/SJOLrigfhh3CvcZEaAKZXkp4FcO4K3ud+HBjFiBA1l3w+e+zRx3AOOr7DrHzgL8sf4BAecr8cxeyA== X-Google-Smtp-Source: AGHT+IG+M4hKNGNKVhzjEt26OPCQgJNv5FMhHEeMhIvr3GwvsLGIV4si6LU1cxofrU+xSNpz/CcV X-Received: by 2002:a17:902:e752:b0:1e3:ff5e:159f with SMTP id p18-20020a170902e75200b001e3ff5e159fmr6406160plf.18.1714200680167; Fri, 26 Apr 2024 23:51:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714200680; cv=pass; d=google.com; s=arc-20160816; b=WjaGswYkdF19+PQulVWZgqNipsgIVNPSYkgraAd6MkbpXMUgGQguASFNJS37PaC/8Q Jfkk350JOMUhmDbRLFxOXRS6b7Cf/4Y5RyKjPDusVN0w26QjV33oVp0qEYiO97VdfW6x mT3/VdZ81jfP6NDENyv6qkmkYvwAdh4M0fwqcaILMMJ76xjhyk1xAAmSYuVZXVZyL3JS Sz4q7jhGxtRYNP3RPYSt/UFbJrB4j7SKrUJ3LiVhM6PBcm71iEBYMAvarPM/yp2KI/cA SoXQ7tzR5w4YvxLumH2+iCSJ6+5Rf1iFryN7IO1wDpkgy3XkXhQwTR6UPwS98vkeT1pA GBJQ== 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=fxFpIXtgd+aMlKeworDRGgf8Q7//hXXW2VVMLwdZ4PI=; fh=aSrwe2FKDnd6R1PfadsUk5SrqtJEJF1O7AJT6dTfxBA=; b=aM+7xVZTKLPEtf4awNbAISVJH71GtGrcM12gWQjMJCY+WctUxbumUwxL4rUS36T3P4 bh7huji+/EbxApvzuiSrf+KDhNpQ4w/nPebHrYA4xczd8l/8fCx9ygJZG+tkm8WPFxsM JJD6cthha6j818IywZ5VWZrJfQ9KygnEIi02wsbq/8V3y/rMOTCknBM0paU2FIreTaB1 Pk3eYtfGpxBfVLP6KNljLCoR4FD+x67m8swrT0jmsX7U9BBzZAAgGPSx84JYhFwaRfTd LKZrj4G/XIKDPZiTmdRRThyctS3Ognjv0+XiXeEPOQA/7x73FtpdJIcoyeGx5R7SWMdH aQbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dCR/KkEW"; 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-160927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160927-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u9-20020a170903124900b001e0afd270d8si16497540plh.302.2024.04.26.23.51.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 23:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="dCR/KkEW"; 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-160927-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160927-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BD6F3283B93 for ; Sat, 27 Apr 2024 06:51:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DAD041A92; Sat, 27 Apr 2024 06:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dCR/KkEW" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 02D9D40BFE for ; Sat, 27 Apr 2024 06:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714200674; cv=none; b=pPRt+IpzLjWU63WShKdvaicoI5v7Sc2L1gH5VT+1FSwToFJfJh0kKAGY/Zjn5ZOyHkV8INH48PE2oxlRm/3+dijKSbYJB48sVnE6acsoV/Drqs0DdigR94C6j7pZMvPHoyuXfA5CKCrMJzV6gTr/wcSDnD1NZq1Z+7hq+1wppLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714200674; c=relaxed/simple; bh=+8fHiqSvp87bfsm5i3JFm6jKcrmiLQejBZ59Pb1qxSs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=u0R6tUADAOX4XGL7679mFgFzyDxxq2MDZVfY3wUKZikp1x4c24RvpCG7M01382WQLU9QY+gmqCe7Bz3SlL7/lO9w6smDy2HOc0eLg/u3swKo8E+2kmrc1takh5ybEcQYiyMQWGewf1voMCEBi5bfBc6NrzI0NKT6BExZt8zJUJ4= 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=dCR/KkEW; arc=none smtp.client-ip=170.10.133.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=1714200670; 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=fxFpIXtgd+aMlKeworDRGgf8Q7//hXXW2VVMLwdZ4PI=; b=dCR/KkEWIjwA6l9S60XSMVvvAGcin93/gl7W9mYpU+vxfOyeSR5tGZ+B5/G1qVU788CpjK 9sQxuYwZwnT9NJgnwK4Od7EY9kkapdEu+pbk5YfYtMvx0m2al3vM2/dlCvXqIdp/xItaUW 5TS5b3eTwE3lXueEfTpWwHW+h3v/wSk= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-134-lbKu0PBoNii9h2WgL-PsSA-1; Sat, 27 Apr 2024 02:51:09 -0400 X-MC-Unique: lbKu0PBoNii9h2WgL-PsSA-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2d88271f485so22012101fa.1 for ; Fri, 26 Apr 2024 23:51:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714200667; x=1714805467; 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=fxFpIXtgd+aMlKeworDRGgf8Q7//hXXW2VVMLwdZ4PI=; b=C1tCr1HhsQiCbTprYs6PQv/dMCEHXvD7hF7exYWpiz0JcZQcRHVupm2gadoWXMB3LY xmg8f6vIL8E6uP9Z9cYTkBwjQ0Urmq5DaaFg8Oq2+W7dHo8c2K16bdqJYF3xz2+5yeU/ qygIwIWSIgXrHhMM2fUTs3ZJ2MpavfPqNmg+/kseQmLNew/uIsNQZmdFjAC6HzppVlvo HBfbHI0Y2BK3BS+7D1y+gEb8RCw7yJ1tq3+cJb8QcFjKfqF1EUfKZXoI7V1a0CsGNBAr dYvuLpSClh6CTU3hehfR0hK4AEvRdPa1Xr+onW1M6dzv4JeqycT2D9q093RuQxD3KlrQ pbug== X-Forwarded-Encrypted: i=1; AJvYcCWk/sJ9zbFJFxIT/gp3VuVOKmxdJnBZ39i5OWDs0YYmbpIMiWf4D9IyGJZWfCiCYxdWXv3jy/GDTR5EqqERRYo9tkHvDuUHFMUQTYAr X-Gm-Message-State: AOJu0YyIacsW55AHPsoDyxJuMvUZawGSShdytzztePeoy6nHBFf1C6fY 9RQuR7VVIJpcb0Dk3p0GvX3NkFsLB7jWbg4670L5KuRLzxSJ3ptt9hvhi8xBoQI95bffN/B2kur x8ifaz0ExvRqtvK0Am57KZRS3Tg0FUWFF8i2cVyRbx2FvGSwS0k/aimkXpKwM1A== X-Received: by 2002:a05:6512:20ca:b0:51b:455a:d649 with SMTP id u10-20020a05651220ca00b0051b455ad649mr2406135lfr.38.1714200667624; Fri, 26 Apr 2024 23:51:07 -0700 (PDT) X-Received: by 2002:a05:6512:20ca:b0:51b:455a:d649 with SMTP id u10-20020a05651220ca00b0051b455ad649mr2406120lfr.38.1714200667175; Fri, 26 Apr 2024 23:51:07 -0700 (PDT) Received: from ?IPV6:2003:cb:c731:9c00:2aaa:88a4:e41d:65ba? (p200300cbc7319c002aaa88a4e41d65ba.dip0.t-ipconnect.de. [2003:cb:c731:9c00:2aaa:88a4:e41d:65ba]) by smtp.gmail.com with ESMTPSA id t26-20020ac24c1a000000b0051979e3a586sm3249926lfq.266.2024.04.26.23.51.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 23:51:06 -0700 (PDT) Message-ID: <436316d3-7fee-4843-93f3-1c07860566c8@redhat.com> Date: Sat, 27 Apr 2024 08:51: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 v5] mm/rmap: do not add fully unmapped large folio to deferred split list To: Lance Yang Cc: Zi Yan , Andrew Morton , linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Yang Shi , Ryan Roberts , Barry Song <21cnbao@gmail.com>, linux-kernel@vger.kernel.org References: <20240426190253.541419-1-zi.yan@sent.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/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v0fFJOA9ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ 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: 8bit On 27.04.24 06:06, Lance Yang wrote: > On Sat, Apr 27, 2024 at 4:16 AM David Hildenbrand wrote: >> >> On 26.04.24 21:20, Zi Yan wrote: >>> On 26 Apr 2024, at 15:08, David Hildenbrand wrote: > [...] >>>>> + bool partially_mapped = false; > [...] >>>>> + >>>>> + partially_mapped = !!nr && !!atomic_read(mapped); >>>> >>>> Nit: The && should remove the need for both !!. >>> >>> My impression was that !! is needed to convert from int to bool and I do >>> find "!!int && !!int" use in the kernel. >> >> I might be wrong about this, but if you wouldn't write > > I think you're correct. > >> >> if (!!nr && !!atomic_read(mapped)) >> >> then >> >> bool partially_mapped = nr && atomic_read(mapped); >> >> is sufficient. > > +1 > >> >> && would make sure that the result is either 0 or 1, which >> you can store safely in a bool, no matter which underlying type >> is used to store that value. >> >> But I *think* nowdays, the compiler will always handle that >> correctly, even without the "&&" (ever since C99 added _Bool). >> >> Likely, also >> >> bool partially_mapped = nr & atomic_read(mapped); >> >> Would nowadays work, but looks stupid. >> >> >> Related: https://lkml.org/lkml/2013/8/31/138 >> >> --- >> #include >> #include >> #include >> #include >> >> volatile uint64_t a = 0x8000000000000000ull; >> >> void main (void) { >> printf("uint64_t a = a: 0x%" PRIx64 "\n", a); >> >> int i1 = a; >> printf("int i1 = a: %d\n", i1); >> >> int i2 = !!a; >> printf("int i2 = !!a: %d\n", i2); >> >> bool b1 = a; >> printf("bool b1 = a: %d\n", b1); >> >> bool b2 = !!a; >> printf("bool b2 = !!a: %d\n", b2); >> } >> --- >> $ ./test >> uint64_t a = a: 0x8000000000000000 >> int i1 = a: 0 >> int i2 = !!a: 1 >> bool b1 = a: 1 >> bool b2 = !!a: 1 >> --- >> >> Note that if bool would be defined as "int", you would need the !!, otherwise you >> would lose information. > > Agreed. We need to be careful in this case. > >> >> But even for b1, the gcc generates now: >> >> 40118c: 48 8b 05 7d 2e 00 00 mov 0x2e7d(%rip),%rax # 404010 >> 401193: 48 85 c0 test %rax,%rax >> 401196: 0f 95 c0 setne %al >> >> >> My stdbool.h contains >> >> #define bool _Bool >> >> And I think C99 added _Bool that makes that work. >> >> But I didn't read the standard, and it's time for the weekend :) > > I just read the C99 and found some interesting information as follows: > > 6.3.1.2 Boolean type > When any *scalar value* is converted to _Bool, the result is 0 if the > value compares equal to 0; otherwise, the result is 1. > > 6.2.5 Types > 21. Arithmetic types and pointer types are collectively called *scalar > types*. Array and structure types are collectively called aggregate types. > > 6.5.13 Logical AND operator > Semantics > The && operator shall yield 1 if both of its operands compare unequal to > 0; otherwise, it yields 0. The result has type int. > > 6.5.10 Bitwise AND operator > Constraints > Each of the operands shall have integer type. > Semantics > The result of the binary & operator is the bitwise AND of the operands > (that is, each bit in the result is set if and only if each of the > corresponding > bits in the converted operands is set). > > && would ensure that the result is either 0 or 1, as David said, so no worries. > My example was flawed: I wanted to express that "if any bit is set, the bool value will be 1. That works for "| vs ||" but not for "& vs &&", obviously :) > We defined partially_mapped as a bool(_Bool). IIUC, "partially_mapped > = int & int;" > would work correctly as well. However, "partially_mapped = long & > int;" might not. Implicit type conversion would convert "long & int" to "long & long" first, which should work just fine. I think really most concerns regarding the bool type are due to < C99 not supporting _Bool. Great weekend everybody! -- Cheers, David / dhildenb