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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 0C367C433DF for ; Mon, 15 Jun 2020 11:22:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D3F5D20663 for ; Mon, 15 Jun 2020 11:22:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iz8UBzrK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3F5D20663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+anElHkxEqvLcsErlDcQsGavcyqaqwXHb1PBVtaaf3k=; b=iz8UBzrK1MQ9f+ QmgZzjBkZjYPx6RJF4E5WEHnnJOFYeSLatUw7VChUqFybuTNychWOy0a43T4juYakncYZHy0EGhh3 TLbDInB0XlgGRGekjBmh5a3CtVmw0sPgFjIa5a/YrnxHXzGoi6RaRN8axh3UQ/No7F5PFA9lEJE6n n/mmfJmLXIr3c9EHZuqWnFS4OFbxxaYS97Z9fwIpq35IvpMXx4CHrZrz/jl7IiC5BLcHTXFMS98ID QjciozTW52qczMHLgrEVVURmAwsoFvDBDPOADWQwKnJP3gMHpeawc81CYrA28rX5KHHVIyEKNS3c7 cCmX3VZJXco9vM8FyXIA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jknCS-0006b8-4b; Mon, 15 Jun 2020 11:22:48 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jknCO-0006aL-Rm for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2020 11:22:46 +0000 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-47-9KR430kxM7Czl-jMyYnSMw-1; Mon, 15 Jun 2020 12:22:36 +0100 X-MC-Unique: 9KR430kxM7Czl-jMyYnSMw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Jun 2020 12:22:35 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 15 Jun 2020 12:22:35 +0100 From: David Laight To: 'Al Viro' , afzal mohammed Subject: RE: [RFC 1/3] lib: copy_{from,to}_user using gup & kmap_atomic() Thread-Topic: [RFC 1/3] lib: copy_{from,to}_user using gup & kmap_atomic() Thread-Index: AQHWQZeuKY4+jVw3gESBYOJARK44Q6jZh6/w Date: Mon, 15 Jun 2020 11:22:35 +0000 Message-ID: <3ef1b43f182041bc9585f5fd462a092f@AcuMS.aculab.com> References: <9e1de19f35e2d5e1d115c9ec3b7c3284b4a4e077.1591885760.git.afzal.mohd.ma@gmail.com> <20200612135538.GA13399@afzalpc> <20200613120432.GA5319@afzalpc> <20200613125126.GE23230@ZenIV.linux.org.uk> <20200613125615.GF23230@ZenIV.linux.org.uk> <20200613134236.GA4086@afzalpc> <20200613153102.GG23230@ZenIV.linux.org.uk> In-Reply-To: <20200613153102.GG23230@ZenIV.linux.org.uk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200615_042245_189621_6AB230C1 X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Nicolas Pitre , Catalin Marinas , Linus Walleij , Russell King - ARM Linux admin , "linux-kernel@vger.kernel.org" , Linux-MM , Will Deacon , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Al Viro > Sent: 13 June 2020 16:31 > On Sat, Jun 13, 2020 at 07:12:36PM +0530, afzal mohammed wrote: > > Hi, > > > > On Sat, Jun 13, 2020 at 01:56:15PM +0100, Al Viro wrote: > > > > > Incidentally, what about get_user()/put_user()? _That_ is where it's > > > going to really hurt... > > > > All other uaccess routines are also planned to be added, posting only > > copy_{from,to}_user() was to get early feedback (mentioned in the > > cover letter) > > Sure, but what I mean is that I'd expect the performance loss to be > dominated by that, not by copy_from_user/copy_to_user on large amounts > of data. Especially on the loads like kernel builds - a lot of stat() > and getdents() calls there. Or any network traffic where the number of usercopies involved in, for example, sendmsg() gives a measurable performance decrease when HARDENED_USERCOPY is enabled. Do you have issues with cache aliasing? (Is aliasing the right term?) Where potentially the temporary kernel map doesn't use the same cache lines as the user processes map. I'm not sure what problem you are trying to solve, but for 64bit systems it may be possible to map all of physical memory into the kernel address map, them you (loosely) only have to find the KVA that matches the user-VA to do the copy. IIRC our SYSV kernels used to do that - until we had 384MB of physical memory and ran out of kernel address space. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel