From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F217FC433ED for ; Fri, 7 May 2021 02:34:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51CC061154 for ; Fri, 7 May 2021 02:34:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51CC061154 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B2BE26B0070; Thu, 6 May 2021 22:34:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC8F26B0071; Thu, 6 May 2021 22:34:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91CBD6B0072; Thu, 6 May 2021 22:34:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 7157F6B0070 for ; Thu, 6 May 2021 22:34:27 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 20934180AD838 for ; Fri, 7 May 2021 02:34:27 +0000 (UTC) X-FDA: 78112866174.22.247112C Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by imf03.hostedemail.com (Postfix) with ESMTP id 6CF01C0001EA for ; Fri, 7 May 2021 02:34:19 +0000 (UTC) Received: by mail-lj1-f182.google.com with SMTP id y9so9656402ljn.6 for ; Thu, 06 May 2021 19:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v5T1rycNE4HG9oZUkYXvP5llXs2aWf6PeX0NDr3FT7o=; b=g8wIE8bJtPt/5As/LkKG+NNYK+6QslXCgx/RIl27/cKjeAPerak5tfmzD1KDmSxsw+ NB+H/eAsLHWDUSIxBapdT4cpjnTRn+ggi5kWlTPnx7QEnMOcG82cBcukDZXrVcPvkxSW s7hdCOAKGTPKgRkbKO3HZt1mLv5NflNScJwJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v5T1rycNE4HG9oZUkYXvP5llXs2aWf6PeX0NDr3FT7o=; b=CxCbIEcc7vT7Qp5Xbl4oqSmeBmbt1WwK2Lkuq/thhGdhUDItme+x2ko0MACI7f4Mhd +RcPFFmaqZ1Ar5ihDDo8+ZOYqJ8FFIF2gDX2mfNUt8/JitsKxEf0RBc9T0Ux6oDrcWgp LKX0bziVeVfV10ykTl3dTA7AIxSwpKbUp/eMzq4l0PzdTYQm7lxj0fj/0UKE9qUiLQYM 6JMDd6uApzLTz16F+bbiAnBfg34hfR+t631NXd8sdLPyT3F2k+Zqnrvamtd76wyLWBr6 zxRQtYs5sISUEpKC4tXr0FEOxn9ergSavcK51f3fAVx69wIVwtuWHKF90N8EXr12gCH4 jHhw== X-Gm-Message-State: AOAM53397TQYQHgmzAjrK8/IbJi3h/KEkLRFB4MbXorxQihtUIrh40Mr b9Dn/RXmoMsaup7wXxoUMCHIYgXlqJCS/D0U X-Google-Smtp-Source: ABdhPJzQgfscxxYH7jdn6245D3pOHBh8hInbujefHE0CE84sc/AURVfLcMzRBNpFbiWj/TwGVl+BEw== X-Received: by 2002:a2e:9d10:: with SMTP id t16mr5699662lji.253.1620354864996; Thu, 06 May 2021 19:34:24 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id c9sm1516002ljb.22.2021.05.06.19.34.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 May 2021 19:34:24 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id s25so9683104lji.0 for ; Thu, 06 May 2021 19:34:23 -0700 (PDT) X-Received: by 2002:a2e:954a:: with SMTP id t10mr5646469ljh.411.1620354863575; Thu, 06 May 2021 19:34:23 -0700 (PDT) MIME-Version: 1.0 References: <20210506232537.165788-1-peterx@redhat.com> <20210506232537.165788-3-peterx@redhat.com> In-Reply-To: <20210506232537.165788-3-peterx@redhat.com> From: Linus Torvalds Date: Thu, 6 May 2021 19:34:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] mm: gup: allow FOLL_PIN to scale in SMP To: Peter Xu Cc: Linux-MM , Linux Kernel Mailing List , Hugh Dickins , John Hubbard , Jan Kara , Kirill Shutemov , Jason Gunthorpe , Andrew Morton , Kirill Tkhai , Michal Hocko , Oleg Nesterov , Jann Horn , Matthew Wilcox , Andrea Arcangeli Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6CF01C0001EA X-Stat-Signature: 4kx7rhmhp9xgxn73um4jugxxmbujgs6d Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=g8wIE8bJ; spf=pass (imf03.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.182 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none Received-SPF: none (linuxfoundation.org>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=mail-lj1-f182.google.com; client-ip=209.85.208.182 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620354859-941834 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, May 6, 2021 at 4:25 PM Peter Xu wrote: > > + if (flags & FOLL_PIN && !atomic_read(&mm->has_pinned)) Please add parentheses to clarify code like this and make the grouping much more visually obvious. Yes, yes, '&' has higher precedence than '&&'. This is not about the compiler, this is about the humans reading it. So please write it as if ((flags & FOLL_PIN) && !atomic_read(&mm->has_pinned)) instead (this problem remains - and the fix is the same - in the 3/3 patch). Otherwise the series looks fine to me (although admittedly I do find the commit message to be ridiculously verbose for such a trivial patch - at some point the actual _point_ if it all gets hidden in the long commit message). Linus