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=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 80664C433E0 for ; Sat, 13 Jun 2020 12:51:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ECDEE2074D for ; Sat, 13 Jun 2020 12:51:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECDEE2074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4D0916B0002; Sat, 13 Jun 2020 08:51:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 481A16B0003; Sat, 13 Jun 2020 08:51:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 396AA6B0005; Sat, 13 Jun 2020 08:51:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 2062E6B0002 for ; Sat, 13 Jun 2020 08:51:44 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CAB62824556B for ; Sat, 13 Jun 2020 12:51:43 +0000 (UTC) X-FDA: 76924175286.05.head75_340e59726de5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id A895B1826B6A5 for ; Sat, 13 Jun 2020 12:51:43 +0000 (UTC) X-HE-Tag: head75_340e59726de5 X-Filterd-Recvd-Size: 2863 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Sat, 13 Jun 2020 12:51:43 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.93 #3 (Red Hat Linux)) id 1jk5d8-008Ab6-23; Sat, 13 Jun 2020 12:51:26 +0000 Date: Sat, 13 Jun 2020 13:51:26 +0100 From: Al Viro To: afzal mohammed Cc: Arnd Bergmann , Russell King - ARM Linux admin , Linus Walleij , "linux-kernel@vger.kernel.org" , Linux-MM , Linux ARM , Nicolas Pitre , Catalin Marinas , Will Deacon Subject: Re: [RFC 1/3] lib: copy_{from,to}_user using gup & kmap_atomic() Message-ID: <20200613125126.GE23230@ZenIV.linux.org.uk> References: <9e1de19f35e2d5e1d115c9ec3b7c3284b4a4e077.1591885760.git.afzal.mohd.ma@gmail.com> <20200612135538.GA13399@afzalpc> <20200613120432.GA5319@afzalpc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200613120432.GA5319@afzalpc> X-Rspamd-Queue-Id: A895B1826B6A5 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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...