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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 362F4C00043 for ; Mon, 23 Sep 2019 21:09:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E97B820665 for ; Mon, 23 Sep 2019 21:09:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="SzjH/eLj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E97B820665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 831456B02B4; Mon, 23 Sep 2019 17:09:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E1746B02B6; Mon, 23 Sep 2019 17:09:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F7B26B02B7; Mon, 23 Sep 2019 17:09:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0044.hostedemail.com [216.40.44.44]) by kanga.kvack.org (Postfix) with ESMTP id 4E5BA6B02B4 for ; Mon, 23 Sep 2019 17:09:09 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id E81D8180AD806 for ; Mon, 23 Sep 2019 21:09:08 +0000 (UTC) X-FDA: 75967425576.06.debt10_8a00fdcd33051 X-HE-Tag: debt10_8a00fdcd33051 X-Filterd-Recvd-Size: 4626 Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Sep 2019 21:09:08 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 23 Sep 2019 14:09:09 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 23 Sep 2019 14:09:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 23 Sep 2019 14:09:06 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Sep 2019 21:09:06 +0000 Received: from [10.110.48.28] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Sep 2019 21:09:05 +0000 Subject: Re: [PATCH v2 03/11] mm/gup: Applies counting method to monitor gup_pgd_range To: Leonardo Bras , , , Linux-MM CC: Jason Gunthorpe , Thomas Gleixner , "Arnd Bergmann" , Greg Kroah-Hartman , YueHaibing , Keith Busch , Nicholas Piggin , Mike Rapoport , Mahesh Salgaonkar , Richard Fontana , Paul Mackerras , Aneesh Kumar K.V , Ganesh Goudar , "Andrew Morton" , Ira Weiny , "Dan Williams" , Allison Randal References: <20190920195047.7703-1-leonardo@linux.ibm.com> <20190920195047.7703-4-leonardo@linux.ibm.com> <2e060677-eadf-c32e-d8c5-8e22c8ca118e@nvidia.com> <907304d0599684b3caa6773197fd40e09191b48e.camel@linux.ibm.com> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Mon, 23 Sep 2019 14:09:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <907304d0599684b3caa6773197fd40e09191b48e.camel@linux.ibm.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1569272949; bh=kycOKYOOy2iryJBYhGlRwbaTdWBiie5Bq6/GCZS4hXY=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=SzjH/eLjKmhoLsdLthIYRULuajkjfzwsxC5cfvPeKprHP8ZqFqoKlhre8Y1SfJQj3 WaoQI9wPCALeDOlyagDvFrHv8Pw6R6ibBycSeS5yMmiQWSKwjCh0Slsz3xXcQk1dV8 ZWYS9OT+/LcNisMDc390NxXpY8/KfZX9PDlMNAogbG08JCCLsSW5gychxYlRiLznj+ usbrB071y1DteIXCchE/i1a3XpyCvlL7Iz11URRwYsFCTNXObwY9n8jU/ulx/6jH/Q PAopijqQbEHIp+wMsdVGyVXtZbWaqv31O+cDq7ycB1fMkj9bGjwiqTkSCP80EFj2tt wPdc9SXpgIw4g== 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 9/23/19 2:01 PM, Leonardo Bras wrote: > On Mon, 2019-09-23 at 13:27 -0700, John Hubbard wrote: >> I'd also like a second opinion from the "core" -mm maintainers, but it seems like >> there is now too much code around the gup_pgd_range() call. Especially since there >> are two places where it's called--did you forget the other one in >> __get_user_pages_fast(), btw?? >> > Oh, sorry, I missed this one. I will put it on v3. > (Also I will make sure to include linux-mm on v3.) > >> Maybe the irq handling and atomic counting should be moved into start/finish >> calls, like this: >> >> start_gup_fast_walk() >> gup_pgd_range() >> finish_gup_fast_walk() > > There are cases where interrupt disable/enable is not done around the > lockless pagetable walk. > It may come from functions called above on stack, that's why I opted it > to be only the atomic operation. > That doesn't prevent you from writing the above as shown, though, for mm/gup.c. (Also, let's see on the other thread if it is even valid to be indicating a lockless walk, without also disabling interrupts.) thanks, -- John Hubbard NVIDIA 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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 5A13DC432C2 for ; Mon, 23 Sep 2019 21:10:57 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE68A206C2 for ; Mon, 23 Sep 2019 21:10:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="SzjH/eLj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE68A206C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46ccRy4NM9zDqPW for ; Tue, 24 Sep 2019 07:10:54 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nvidia.com (client-ip=216.228.121.143; helo=hqemgate14.nvidia.com; envelope-from=jhubbard@nvidia.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=nvidia.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nvidia.com header.i=@nvidia.com header.b="SzjH/eLj"; dkim-atps=neutral Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46ccPy6CqVzDqF1 for ; Tue, 24 Sep 2019 07:09:10 +1000 (AEST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 23 Sep 2019 14:09:09 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 23 Sep 2019 14:09:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 23 Sep 2019 14:09:06 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Sep 2019 21:09:06 +0000 Received: from [10.110.48.28] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 23 Sep 2019 21:09:05 +0000 Subject: Re: [PATCH v2 03/11] mm/gup: Applies counting method to monitor gup_pgd_range To: Leonardo Bras , , , Linux-MM References: <20190920195047.7703-1-leonardo@linux.ibm.com> <20190920195047.7703-4-leonardo@linux.ibm.com> <2e060677-eadf-c32e-d8c5-8e22c8ca118e@nvidia.com> <907304d0599684b3caa6773197fd40e09191b48e.camel@linux.ibm.com> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Mon, 23 Sep 2019 14:09:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <907304d0599684b3caa6773197fd40e09191b48e.camel@linux.ibm.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1569272949; bh=kycOKYOOy2iryJBYhGlRwbaTdWBiie5Bq6/GCZS4hXY=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=SzjH/eLjKmhoLsdLthIYRULuajkjfzwsxC5cfvPeKprHP8ZqFqoKlhre8Y1SfJQj3 WaoQI9wPCALeDOlyagDvFrHv8Pw6R6ibBycSeS5yMmiQWSKwjCh0Slsz3xXcQk1dV8 ZWYS9OT+/LcNisMDc390NxXpY8/KfZX9PDlMNAogbG08JCCLsSW5gychxYlRiLznj+ usbrB071y1DteIXCchE/i1a3XpyCvlL7Iz11URRwYsFCTNXObwY9n8jU/ulx/6jH/Q PAopijqQbEHIp+wMsdVGyVXtZbWaqv31O+cDq7ycB1fMkj9bGjwiqTkSCP80EFj2tt wPdc9SXpgIw4g== X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Richard Fontana , Greg Kroah-Hartman , YueHaibing , Nicholas Piggin , Mike Rapoport , Keith Busch , Jason Gunthorpe , Paul Mackerras , "Aneesh Kumar K.V" , Allison Randal , Mahesh Salgaonkar , Ganesh Goudar , Thomas Gleixner , Ira Weiny , Andrew Morton , Dan Williams Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 9/23/19 2:01 PM, Leonardo Bras wrote: > On Mon, 2019-09-23 at 13:27 -0700, John Hubbard wrote: >> I'd also like a second opinion from the "core" -mm maintainers, but it seems like >> there is now too much code around the gup_pgd_range() call. Especially since there >> are two places where it's called--did you forget the other one in >> __get_user_pages_fast(), btw?? >> > Oh, sorry, I missed this one. I will put it on v3. > (Also I will make sure to include linux-mm on v3.) > >> Maybe the irq handling and atomic counting should be moved into start/finish >> calls, like this: >> >> start_gup_fast_walk() >> gup_pgd_range() >> finish_gup_fast_walk() > > There are cases where interrupt disable/enable is not done around the > lockless pagetable walk. > It may come from functions called above on stack, that's why I opted it > to be only the atomic operation. > That doesn't prevent you from writing the above as shown, though, for mm/gup.c. (Also, let's see on the other thread if it is even valid to be indicating a lockless walk, without also disabling interrupts.) thanks, -- John Hubbard NVIDIA