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 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 4E61CC433E0 for ; Sat, 13 Jun 2020 12:56:33 +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 0CADC2074D for ; Sat, 13 Jun 2020 12:56:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZMPx6QFM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CADC2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kPDhjdZ1SfQfKwWGzKqZkYyiaz4aw08sJN9yUi87w8o=; b=ZMPx6QFMBUY3eP /2tSpeUXQJmPlf4ZFQnMbKIoh+r/gep0JRmq0OYoGj/X3LNGzTlCPcBPXGPy5eFRV/wB2wKwFn8Fv jFJvce0nhaAT4z/wXgodKCRWQvcIZoVX0FDpVp0DDjP4qCBDdAELtyAVy1vlnZiEnFSWmHXzfkNmB GsxJN9Nlu3lrkh9mblfM+z4Hk2sgF5Hv9tEa5g0coyFsEDzHLGbq2ZhyZmy4HZIh/mwHsU+OjgOA4 KZx04v2T7G/c10cjq59eEnVM2zvZfX8ksjB//Zag981w9kr6lo+F6Jrwc/v8QmDWYnfrDzYRv6G/t 1crvJF94/oO5ngLCd9bQ==; 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 1jk5hx-0003Ad-MM; Sat, 13 Jun 2020 12:56:25 +0000 Received: from [2002:c35c:fd02::1] (helo=ZenIV.linux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jk5hu-0003A0-QR for linux-arm-kernel@lists.infradead.org; Sat, 13 Jun 2020 12:56:24 +0000 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jk5hn-008AgX-Br; Sat, 13 Jun 2020 12:56:15 +0000 Date: Sat, 13 Jun 2020 13:56:15 +0100 From: Al Viro To: afzal mohammed Subject: Re: [RFC 1/3] lib: copy_{from,to}_user using gup & kmap_atomic() Message-ID: <20200613125615.GF23230@ZenIV.linux.org.uk> References: <9e1de19f35e2d5e1d115c9ec3b7c3284b4a4e077.1591885760.git.afzal.mohd.ma@gmail.com> <20200612135538.GA13399@afzalpc> <20200613120432.GA5319@afzalpc> <20200613125126.GE23230@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200613125126.GE23230@ZenIV.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200613_055622_855037_66311B3B X-CRM114-Status: GOOD ( 14.48 ) 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 On Sat, Jun 13, 2020 at 01:51:26PM +0100, Al Viro wrote: > On Sat, Jun 13, 2020 at 05:34:32PM +0530, afzal mohammed wrote: > > > Observation is that max. pages reaching copy_{from,to}_user() is 2, > > observed maximum of n (number of bytes) being 1 page size. i think C > > library cuts any size read, write to page size (if it exceeds) & > > invokes the system call. Max. pages reaching 2, happens when 'n' > > crosses page boundary, this has been observed w/ small size request > > as well w/ ones of exact page size (but not page aligned). > > > > Even w/ dd of various size >4K, never is the number of pages required > > to be mapped going greater than 2 (even w/ 'dd' 'bs=1M') > > > > i have a worry (don't know whether it is an unnecessary one): even > > if we improve performance w/ large copy sizes, it might end up in a > > sluggishness w.r.t user experience due to most (hence a high amount) > > of user copy calls being few bytes & there the penalty being higher. > > And benchmark would not be able to detect anything abnormal since > > usercopy are being tested on large sizes. > > > > Quickly comparing boot-time on Beagle Bone White, boot time increases > > by only 4%, perhaps this worry is irrelevant, but just thought will > > put it across. > > Do stat(2) of the same tmpfs file in a loop (on tmpfs, to eliminate > the filesystem playing silly buggers). And I wouldn't expect anything > good there... Incidentally, what about get_user()/put_user()? _That_ is where it's going to really hurt... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel