Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5136774rwd; Tue, 23 May 2023 19:12:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ78oVpwAEA5n2wKWga34ejMfeMLnrNM+QgqTghS5uGvHNDY7vjI/ifi1DHOgaJ/WN4H7HbT X-Received: by 2002:a17:903:124b:b0:1ae:a44:841c with SMTP id u11-20020a170903124b00b001ae0a44841cmr18052727plh.42.1684894333203; Tue, 23 May 2023 19:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684894333; cv=none; d=google.com; s=arc-20160816; b=dPunAN4ZWqGUE5BywXSvKANtDxLLlahksAArJYjlAwf1X2oChZlBt0Bl8HOBiZJslL YV680St9aInublHdKYzf5V685d/sptIBkPjTmA5ytg7P5t7EGaf77iNEJ8j9XUgjfniz HVBvH2qShDE2ecUP1aA7ZdedJoHjiQJfp7JiZq2//fs9OGVtFzW/G1XYGfU8UaGcbpNe UevXHhQqItIVwtaxwgiUJjDTbOLaF2wDfk5kUoli74NAavkF+/z5NIsfW4S8YRLDO7V7 H74Cya0osobzCiW7Y31K8Ckb+hMYCfKCZPFq0Z6t7ABDktBPoeWXv0f3yK7e89e5+Tp/ Eoug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=D0tshfF7VbkB3ahpyG7j9+uSF5/xmyUxNJpS8HDSR6c=; b=d3pD0M6ElZ5fFA/Gx9EC9jl2R6FJd76hfBCQ8CnGPVhCFKZX0SkADwLP+K4ZXJedKg qcv03+NcV+uaFfos5x711w4pacPqWdMwrmoHwLsBK5n8UJqvw8SMRRBAofrxLiiEiu21 AOYThJ4M6dmrX3juzUXebnFk0wgh6172OeCfaJh17R9olXDYS4xNrE9K8aMwKeApC7sC uiTi0/Kl5n0QLWgXY4oeyZziOgHg/iLYrczlB0THMZXhn3nd5iaVDeduXiopqvDvpgJq EnngLOdNP4YAAWtSMKjn/yaKDdbIoAbQLNPLV/82x9uOmgmzBcB6z4YVfoYR/P0Tn0zl Zl2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=nmhTg7sd; 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 z5-20020a170902834500b001a66c501a46si7276796pln.136.2023.05.23.19.11.58; Tue, 23 May 2023 19:12:13 -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=nmhTg7sd; 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 S236013AbjEXB5Y (ORCPT + 99 others); Tue, 23 May 2023 21:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbjEXB5X (ORCPT ); Tue, 23 May 2023 21:57:23 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F98130 for ; Tue, 23 May 2023 18:57:22 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-562191bcfb9so3872397b3.3 for ; Tue, 23 May 2023 18:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684893441; x=1687485441; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=D0tshfF7VbkB3ahpyG7j9+uSF5/xmyUxNJpS8HDSR6c=; b=nmhTg7sdGevKSn3w9kE12d2P3CP7b9UiGfoMMR/+Y0y6b0wbVHGrG26hVbXCs3d7HX qFb0dxId9p2cI8+fL/S8EjJhcbn7lA39do5yljFCYSveMEIOUmYELDjW9wtaiXClKwM9 B+pF7IoAQrTNexDIgtnV3yfScMywq9BJftsOjdrlWXkz9YzUwS848Vu8/D+vjTZa5HWh PWQDtf1EGZyA5p9yViC7yHfAylqrKXOgwsgQK/zjUPY2UqTti8iJSu3TLEJdyO1niNAG jn0SKqzTEBKg5wjGDls0FwQG6uXRSO5kfS7Uak+ZR6l8yn84qkhn4c04vhj5ZfgomU0O H7gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684893441; x=1687485441; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D0tshfF7VbkB3ahpyG7j9+uSF5/xmyUxNJpS8HDSR6c=; b=Goxd7tS7A9H7rK3esBmrpvmW5hq1DKPfMItXKPtgKZ16XI17IYG+mGGYWzCkcy1zW9 4h30SFkkAXcyY10wGYBsogZA4tIlvRxkrNnPOPq/bF2RPwvZTyrNEvJtHTQggv7OU8Fw 4M8SFGJxoSStYo8irqqnC12gdxLbHhMNRXnnR929oViQMO02j5XLtaI8/WBDhI2vf5DL 7jlxDRrxbtnyM7AxVjsdvpeJte6M5bDu+alvsgZDPOLKXMfCYJlXTMPk5HxN9/dEWara dGHKvw7Th4gTnltnL658i4GPC5iT/4ewpDHrlx/CHg0yTWYcLRP8b3xA6rj6aE4Q5CIO kL4Q== X-Gm-Message-State: AC+VfDykrVjcCF8PH6xfTcBIrIDdwzGtEiTi9DuLhscHgy1vAmIsz4q5 8h7YGdQCQg1HtytXqsh3Caa1jQ== X-Received: by 2002:a81:5289:0:b0:561:e7bb:1b24 with SMTP id g131-20020a815289000000b00561e7bb1b24mr16022359ywb.6.1684893441203; Tue, 23 May 2023 18:57:21 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id d206-20020a814fd7000000b0054605c23114sm3346760ywb.66.2023.05.23.18.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 18:57:20 -0700 (PDT) Date: Tue, 23 May 2023 18:57:17 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Alistair Popple cc: Hugh Dickins , 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 , Yu Zhao , 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 Subject: Re: [PATCH 02/31] mm/migrate: remove cruft from migration_entry_wait()s In-Reply-To: <87bkib95uj.fsf@nvidia.com> Message-ID: <8bc94098-8a57-b62f-a26c-7c73bf945b41@google.com> References: <68a97fbe-5c1e-7ac6-72c-7b9c6290b370@google.com> <1659568-468a-6d36-c26-6a52a335ab59@google.com> <87bkib95uj.fsf@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Tue, 23 May 2023, Alistair Popple wrote: > > Hugh Dickins writes: > > > migration_entry_wait_on_locked() does not need to take a mapped pte > > pointer, its callers can do the unmap first. Annotate it with > > __releases(ptl) to reduce sparse warnings. > > Thanks Hugh, I debated doing something similar when I reworked this to > not take a pageref. However I was unsure if the pte unmap/unlock > ordering mattered as this reverses the order of operations (from unlock > then unmap to unmap then unlock). > > I never found any reason why that would be a problem though so please > add: > > Reviewed-by: Alistair Popple Thanks Alistair. Right, the ordering doesn't matter: you might briefly think that because I'm going to put the rcu_read_unlock() into the pte_unmap(), that there's something wrong with doing that early; but you'd quickly realize that holding on to the spinlock is good enough. Hugh