Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp163389rwd; Wed, 24 May 2023 16:03:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4EC9C+QoGykX3anFnhw5ncYq0rzE7Yu+d88Mb0ZeXCW3hs1I7wigBVk5GVq4w+eS9t50JA X-Received: by 2002:a05:6a20:4c9:b0:109:c161:a67d with SMTP id 9-20020a056a2004c900b00109c161a67dmr15002924pzd.18.1684969386945; Wed, 24 May 2023 16:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684969386; cv=none; d=google.com; s=arc-20160816; b=thju9PBwW75SAURJk5v79pRiLuRadfoSHsYNFTLdklo9mp23Tt1hgClEFT+kqks3AI bgfWDZAT3Cm7y9ffe83/dqJnmVtJ8ZnSzenFi1mW16ugYJZI/TOAsCZSK0dugI9mEZbW NDzUElWpriKA4aSUEZSHDpGoH7i7UduB1FYqWHXNctZ9JROf+LewxE/bIbzN/eqQryw4 VbjqaBf3x0Y4JxfsMa3/GjFZ3Zrs3usZOnw9dCFS6vDica6QN4naum1ZwOLQHCq/LMRf hxqRgm66F4mi6bF2lIzG21d6oCm/Ef3QkaHb8WNToC625wvx+wLQKVOvQp51JCZ5qKgy cU6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5PFZGaJq8MtD3XUYUpQ3Rfh0TSuFecS+vZ1Ibl7OUjU=; b=GDbFCXFPJSS026ND5FS+J+QE7hrgYQUu6MU+IWEs/hURgRAOgzT8qUo27H3ID1YFKU 0NpnCTDJf7dGAPTmARGoDIRuwETbT7hNUwFkK3Bmc1J/Y7r3mbxD8Vg00qfVRgq3/ETJ dZOjJntR+kDYKZD6jxIHspr4m8kqYfBYVu3KUK1jWE5GZ5da4D1DXov0PCrwELVxiEkk LxjsKGAHAJOQ+4xtAumfBePoo7HkKm15SaZag9eue+XES8AfmlMWIXOA4mkkoPRhb3Iv wLRqjsvqygip6i6hp+e8m1sz+gQj3wbM1upOIGFDIp/L2NONuu5e0tFyou4PxDo/uJek Y5zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=gUKaYbvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q134-20020a632a8c000000b0052c89d50011si7215306pgq.676.2023.05.24.16.02.51; Wed, 24 May 2023 16:03:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=gUKaYbvr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbjEXWzj (ORCPT + 99 others); Wed, 24 May 2023 18:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjEXWzh (ORCPT ); Wed, 24 May 2023 18:55:37 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B642F90 for ; Wed, 24 May 2023 15:55:36 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-33828a86ee2so66515ab.0 for ; Wed, 24 May 2023 15:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684968936; x=1687560936; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5PFZGaJq8MtD3XUYUpQ3Rfh0TSuFecS+vZ1Ibl7OUjU=; b=gUKaYbvrWDvXXzik7sXzLzjnxqvbYtYE3pM1NUPgN29awaZVR4EehmK9rKNL20KEKe Fw25UT/6xwiF0VgjYMQ0JuGNHKULDipAzGoOd2DaW3S2Y/7+GsM3FTHzTBcakF9RjW1k +1MvvTOx78w5eVdgoLo9xXYSP7tcQI20xV6o0msYi1VvuqBCMFj985EM28z/4Ci1P9VI nRfj7RS9veK4oiWiFMgtbKIGLMMWBGALUtaHLybpM0FWv2fNhBGvdwhFZLOfR6B6ykT7 ziDNo9OjqRZgcrmbl36VyssJlpFtOP5iX9AJN1Sm+J+qR6dkdq0v2YArBPfYKMAyI9yu /ruw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684968936; x=1687560936; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5PFZGaJq8MtD3XUYUpQ3Rfh0TSuFecS+vZ1Ibl7OUjU=; b=JR7aBX2dz+XaVByHfCz2cOkYPohfqQaHiPmgzyuxANCsQQWW4mhjlRBYFQOThETwLu XIDA5chOB8XmcG+SrPhLhwz3fghfQ4pthnM6jijK1connib807GraZoMuMlMVWBcWAbX 99Ky6wDa1azDvhbZkUrLs59IcrM+YNMsgpZz9CfCsHEJCsgWgC32AmCkMsdYwORQJHeL P91FJKrZMu2KryIZ7ONKhw28rggWpMSD39grF42TW4thW88RyqP02hVFJ7xrzl7+RluO EixYoQUiSPAUiaOhy6HAu8yxcE+L3hCmqbsrTUd/3y72q7sEtKeAab+5pf+InKr00d/d ObTQ== X-Gm-Message-State: AC+VfDyHdOswMi7MNwxqlYmszQmPKtlr8TWEokRX8puoqZg0fk9vcfqY dAKE9tu2eOVeLVoeWnag9Tcp+8WL849fNyPIS6xQkw== X-Received: by 2002:a05:6e02:219a:b0:328:3a25:4f2e with SMTP id j26-20020a056e02219a00b003283a254f2emr23558ila.9.1684968935966; Wed, 24 May 2023 15:55:35 -0700 (PDT) MIME-Version: 1.0 References: <68a97fbe-5c1e-7ac6-72c-7b9c6290b370@google.com> <34467cca-58b6-3e64-1ee7-e3dc43257a@google.com> In-Reply-To: <34467cca-58b6-3e64-1ee7-e3dc43257a@google.com> From: Yu Zhao Date: Wed, 24 May 2023 16:54:59 -0600 Message-ID: Subject: Re: [PATCH 01/31] mm: use pmdp_get_lockless() without surplus barrier() To: Hugh Dickins Cc: Andrew Morton , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 21, 2023 at 10:49=E2=80=AFPM Hugh Dickins wr= ote: > > Use pmdp_get_lockless() in preference to READ_ONCE(*pmdp), to get a more > reliable result with PAE (or READ_ONCE as before without PAE); and remove > the unnecessary extra barrier()s which got left behind in its callers. > > HOWEVER: Note the small print in linux/pgtable.h, where it was designed > specifically for fast GUP, and depends on interrupts being disabled for > its full guarantee: most callers which have been added (here and before) > do NOT have interrupts disabled, so there is still some need for caution. > > Signed-off-by: Hugh Dickins Acked-by: Yu Zhao The previous ask here: https://lore.kernel.org/r/CAOUHufZo=3DfB2HcaCrj2aidLJ2zEhOpi7ou5M_7qOQiuQq8= +wTQ@mail.gmail.com/