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, URIBL_BLOCKED,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 05658C433DF for ; Sat, 13 Jun 2020 13:16:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3ECA20792 for ; Sat, 13 Jun 2020 13:16:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ja4aLfUr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3ECA20792 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 58B7B6B000A; Sat, 13 Jun 2020 09:16:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53C126B000C; Sat, 13 Jun 2020 09:16:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42A336B000D; Sat, 13 Jun 2020 09:16:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 2919D6B000A for ; Sat, 13 Jun 2020 09:16:23 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CFFBF824556B for ; Sat, 13 Jun 2020 13:16:22 +0000 (UTC) X-FDA: 76924237404.10.bells50_260059126de5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 6D0191698E1 for ; Sat, 13 Jun 2020 13:16:22 +0000 (UTC) X-HE-Tag: bells50_260059126de5 X-Filterd-Recvd-Size: 4130 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Sat, 13 Jun 2020 13:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CTgyUwh6cSz/c+OXjJ8SE3+Fh1Nd5s6JFCqdOiRWMDc=; b=ja4aLfUrZeDtb/Q+hi9fniI0n oDUic4OelYU8+sBynGEk2HzV/Ov9l9/uO5FV6IoNCS3f7i1NHN20jS6OCla7IX1f3zbLTCvXjFunV eyqoKi8AgqM/krztw6qZhGDJDwzLqzpn0hFEQhvsqiui8XVEzhR4KHuj9QlmEiw8Z898MGuh+MYzO yAC1qt7vE2TLy7JQfPmzmoOhZdsEWNiB4+b1SXN3t+TexgESaR4MwHPpxaTVOTD5tP45yoUWH7WLc m/5tNdo5HtvwcjOo+pCYohEuwEpbvpuiMGtwDBZ7cURslG8zRUeKZpukT5nXqjH23RafeSgA2QC0s Kov0DeIXA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51576) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk60y-0005SM-Pj; Sat, 13 Jun 2020 14:16:08 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jk60m-0007LO-M9; Sat, 13 Jun 2020 14:15:52 +0100 Date: Sat, 13 Jun 2020 14:15:52 +0100 From: Russell King - ARM Linux admin To: afzal mohammed Cc: Arnd Bergmann , Nicolas Pitre , Catalin Marinas , Linus Walleij , "linux-kernel@vger.kernel.org" , Linux-MM , Will Deacon , Linux ARM Subject: Re: [RFC 1/3] lib: copy_{from,to}_user using gup & kmap_atomic() Message-ID: <20200613131552.GL1551@shell.armlinux.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> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 6D0191698E1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: > Hi, > > On Fri, Jun 12, 2020 at 10:07:28PM +0200, Arnd Bergmann wrote: > > > I think a lot > > of usercopy calls are only for a few bytes, though this is of course > > highly workload dependent and you might only care about the large > > ones. > > 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). You can't make that assumption about read(2). stdio in the C library may read a page size of data at a time, but programs are allowed to call read(2) directly, and the C library will pass such a call straight through to the kernel. So, if userspace requests a 16k read via read(2), then read(2) will be invoked covering 16k. As an extreme case, for example: $ strace -e read dd if=/dev/zero of=/dev/null bs=1048576 count=1 read(0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1048576) = 1048576 -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!