Message ID | 0-v4-908497cf359a+4782-gup_fork_jgg@nvidia.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <SRS0=ew8G=EQ=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8D58138B for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 10 Nov 2020 23:44:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6B2D120825 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 10 Nov 2020 23:44:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="CVCrGSMb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B2D120825 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 70F8A6B0036; Tue, 10 Nov 2020 18:44:20 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6BD8D6B005D; Tue, 10 Nov 2020 18:44:20 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C2216B006C; Tue, 10 Nov 2020 18:44:20 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 179156B0036 for <linux-mm@kvack.org>; Tue, 10 Nov 2020 18:44:20 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BC11E181AC9CC for <linux-mm@kvack.org>; Tue, 10 Nov 2020 23:44:19 +0000 (UTC) X-FDA: 77470139838.10.jar15_5e13ec5272f9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 996D416A047 for <linux-mm@kvack.org>; Tue, 10 Nov 2020 23:44:19 +0000 (UTC) X-Spam-Summary: 1,0,0,23a92f6beda0bbc3,d41d8cd98f00b204,jgg@nvidia.com,,RULES_HIT:41:69:355:379:800:960:967:973:988:989:1260:1261:1277:1311:1313:1314:1345:1431:1437:1513:1515:1516:1518:1521:1535:1542:1711:1730:1747:1777:1792:2194:2199:2393:2525:2553:2559:2565:2570:2682:2685:2703:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3353:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4118:4250:4321:4605:5007:6261:7875:7903:9010:9025:10004:10400:11658,0,RBL:203.18.50.4:@nvidia.com:.lbl8.mailshell.net-64.201.201.201 62.22.107.100;04yfsy7r5rtnokc7ssw8dckbc4radyprafcde41u5xgb8aoe6pkruripjozyn99.i57msjank4815e7jafztt7rso7nk8yi69upwqjp95r8wdeihjreax163xxjpmqu.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:69,LUA_SUMMARY:none X-HE-Tag: jar15_5e13ec5272f9 X-Filterd-Recvd-Size: 7184 Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by imf11.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Tue, 10 Nov 2020 23:44:18 +0000 (UTC) Received: from HKMAIL104.nvidia.com (Not Verified[10.18.92.100]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id <B5fab25ce0001>; Wed, 11 Nov 2020 07:44:15 +0800 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 10 Nov 2020 23:44:14 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.54) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 10 Nov 2020 23:44:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cw37daPpwJvVYTbCJWVeje021A5tMA445JV+Mtia+97DoHN/+n04ke+j24vD1cO0usR73Eq4B0htM7IENl7Do2k1JwnPxhy85ViLZkgzicZitSZ2x8SdTtCI6QmgjuC5SQD5e7LJo2VfHhgTc2EWpq84wAtnmtYew429laOGQzZ/kfS1lr5MM0E219sbTzjKpSJVPFgDEmUC1LAgODUoJGGyRi9OH2PkAI80XReQOKAyu92OFb036HtsKx2DZqur9poudPleuveFmy3E+/5akVudw5Ae+2GrZYeS8lX6G8jq7tSLB0Df0Qxpy1vL1hObDNfgX/ZeUTBTDlur1IbI6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zE3T3/e7QFMKOiT4QdMggSeF+m2I+3ock9sMuBcNYEU=; b=VV3m9caJ647lXeKvjFdnp2pCO3+59u+1sgBP8Ih4bcoBSclsaWhJqLKX4+5u5eQlacgEwL8vxoAd/6+SSPHosaQnOYvUuYEDeLWZL6ylk9TF3Nx76jOMvDE2K+iclUNhDrEQI2IIWeZXDoUmXYO0joxrjpS6e06+e4mU7zykb/K4UDRvp25gRKtAJ8SEt56f+AZXijajaZJiCCZcWiybBmTbqCu807lmrtWd0bu7bDp3RxLlyx85ki9c3CLybRFS8AhsXZppJcypbaLx/Mwk8TkRZK0YfHhT0GuWvBmqKTwIRNtsmr+jHJQzNgcW8UyhlMTkPtDFoGzZGPHRwskgyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM6PR12MB3739.namprd12.prod.outlook.com (2603:10b6:5:1c4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.24; Tue, 10 Nov 2020 23:44:11 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::cdbe:f274:ad65:9a78]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::cdbe:f274:ad65:9a78%7]) with mapi id 15.20.3499.032; Tue, 10 Nov 2020 23:44:11 +0000 From: Jason Gunthorpe <jgg@nvidia.com> To: <linux-kernel@vger.kernel.org>, Peter Xu <peterx@redhat.com>, Linus Torvalds <torvalds@linux-foundation.org> CC: "Ahmed S. Darwish" <a.darwish@linutronix.de>, Andrea Arcangeli <aarcange@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>, Christoph Hellwig <hch@lst.de>, Hugh Dickins <hughd@google.com>, Jan Kara <jack@suse.cz>, Jann Horn <jannh@google.com>, John Hubbard <jhubbard@nvidia.com>, Kirill Shutemov <kirill@shutemov.name>, Kirill Tkhai <ktkhai@virtuozzo.com>, Leon Romanovsky <leonro@nvidia.com>, Linux-MM <linux-mm@kvack.org>, Michal Hocko <mhocko@suse.com>, Oleg Nesterov <oleg@redhat.com> Subject: [PATCH v4 0/2] Add a seqcount between gup_fast and copy_page_range() Date: Tue, 10 Nov 2020 19:44:07 -0400 Message-ID: <0-v4-908497cf359a+4782-gup_fork_jgg@nvidia.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-ClientProxiedBy: BL1PR13CA0145.namprd13.prod.outlook.com (2603:10b6:208:2bb::30) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (156.34.48.30) by BL1PR13CA0145.namprd13.prod.outlook.com (2603:10b6:208:2bb::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3564.21 via Frontend Transport; Tue, 10 Nov 2020 23:44:10 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from <jgg@nvidia.com>) id 1kcdJ3-0036MF-Bc; Tue, 10 Nov 2020 19:44:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1605051855; bh=sSxdLlqy5pKzAvuhddoSoAooAWo9HIhE52+4XJBO/Qo=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Date:Message-ID:Content-Transfer-Encoding:Content-Type: X-ClientProxiedBy:MIME-Version: X-MS-Exchange-MessageSentRepresentingType; b=CVCrGSMbHd2uASxbVJT9KsB/10JxnhIzfL/FC+djQI5ljNXGgr4jciX9nrhEybAsn z+qh5GBt2bRn3PAXsnJ7/ZOzkfNq+G7XUAmm8TQcMD4/BO16TKB0l+EI9fzgs50D9o GHq/spLMk6ixzplB16SCEqrqNeoCIYcCEG+RcfGtDOOerPvgIHcVFbAdzepaYOv9RB nhws5gwniBXkD7v+yWXg0p7YWFpddsPQnkJGQHIR/oWLNQJJnO7jxTm84ToLPQKH+6 Iz8GFVxsd0WOGfdK4uAWLfP+QQa/zXzbqHnM1+0bSQBwfWHEghOlS3Z7IPbgB8DbHT mtVMjpTiCDq2w== 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: <linux-mm.kvack.org> |
Series |
Add a seqcount between gup_fast and copy_page_range()
|
expand
|
On Tue, Nov 10, 2020 at 3:44 PM Jason Gunthorpe <jgg@nvidia.com> wrote: > > As discussed and suggested by Linus use a seqcount to close the small race > between gup_fast and copy_page_range(). > > Ahmed confirms that raw_write_seqcount_begin() is the correct API to use > in this case and it doesn't trigger any lockdeps. > > I was able to test it using two threads, one forking and the other using > ibv_reg_mr() to trigger GUP fast. Modifying copy_page_range() to sleep > made the window large enough to reliably hit to test the logic. Looks all good to me. Linus