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.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 6D9A8C433DF for ; Sat, 13 Jun 2020 12:04:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 29FEA2078A for ; Sat, 13 Jun 2020 12:04:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CU6y3HBb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 29FEA2078A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B4C826B0006; Sat, 13 Jun 2020 08:04:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFC486B000C; Sat, 13 Jun 2020 08:04:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C33A6B000E; Sat, 13 Jun 2020 08:04:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0068.hostedemail.com [216.40.44.68]) by kanga.kvack.org (Postfix) with ESMTP id 831216B0006 for ; Sat, 13 Jun 2020 08:04:37 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 42B701EF1 for ; Sat, 13 Jun 2020 12:04:37 +0000 (UTC) X-FDA: 76924056594.03.hope06_120a92a26de4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 1CF3628A4EB for ; Sat, 13 Jun 2020 12:04:37 +0000 (UTC) X-HE-Tag: hope06_120a92a26de4 X-Filterd-Recvd-Size: 5056 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Sat, 13 Jun 2020 12:04:36 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id x22so5589080pfn.3 for ; Sat, 13 Jun 2020 05:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LBrsfxO25w2eu+lrtvfG2KxIdSA+88lYE5tWiAEH8qM=; b=CU6y3HBbj/n8jNq32wKmlGbKqblgo+cnqIRVSSA2jz7Qn3+T+ejYaQtqm4xEFmL6/t 7doJiv+0cF/A5BVpe3f6BdSc1JNyzs2vtcAU2MdYBNU0z1Z4K6pnnB0OqimD0U9szNeU Y0OGDGOny5I3deJZfLq2iQYSPI6TuvDm35tjCMgWUMDTc7aeUsrQPrVjW0RZJ95djrgM fkOzUadFV2+ZCwOOLy9YPEAaO93mgN37StRybZlo/Gzt53gP7b/6k6Y2+2FIy+KU66uM 8zCY5yan04lXaJw2BW8w52YzWseMaG5U1yaxcdwWAO4LI7vlFWGlp6txNonl2MiiS09l aXlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LBrsfxO25w2eu+lrtvfG2KxIdSA+88lYE5tWiAEH8qM=; b=KuMTRLpNY0Yf5RFS/RmVHOhnBRMbPMgmbOkreqRYVDBLXuXaeH2DVs7WLuhubmu5H1 Ef7+uFBpPmgJpI4G7Ioavvr3b0z6UUWxScbbaQGCPsRTZ0Kpr/MhqLGeBMKH5ZDxXHZm DKrybdGMcybiJXuGaC9aA6w/oOlslDNTalcNEp4cHqZGjejrXe6h+cqH0q28HDNCESYu zC+Jq5UsNOmBG9rxgeNVcHkatw9LJVQ7Qrg14pHvpHNmnnJ0/IZ6uu0v+3iK7acyBeW2 h3iPHmD34aq1mPg53U7/JDdd0CZoXoA9kIjbNcihFFL7WS0oppDpOFmg0KUwcuQPVB2a WSug== X-Gm-Message-State: AOAM533VYaF+m87NMT/mzIEfsL2RkuxPI/WgpoY/ubcNdTEqPWOu7nUo QFYRCDnl1Rd/JwgEF9cztfs= X-Google-Smtp-Source: ABdhPJwmpmABGRrQm+OFl+czCBJy5iA0MDun8zYJpfbPLnNUBn63dzGlclRFHTHT74RVa9NQlqsc9Q== X-Received: by 2002:a63:e34a:: with SMTP id o10mr14362568pgj.258.1592049875852; Sat, 13 Jun 2020 05:04:35 -0700 (PDT) Received: from localhost ([49.207.210.132]) by smtp.gmail.com with ESMTPSA id k12sm8778184pfk.219.2020.06.13.05.04.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Jun 2020 05:04:35 -0700 (PDT) Date: Sat, 13 Jun 2020 17:34:32 +0530 From: afzal mohammed To: Arnd Bergmann Cc: 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: <20200613120432.GA5319@afzalpc> References: <9e1de19f35e2d5e1d115c9ec3b7c3284b4a4e077.1591885760.git.afzal.mohd.ma@gmail.com> <20200612135538.GA13399@afzalpc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-Rspamd-Queue-Id: 1CF3628A4EB X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: 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). 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. > There is also still hope of optimizing small aligned copies like > > set_ttbr0(user_ttbr); > ldm(); > set_ttbr0(kernel_ttbr); > stm(); Hmm, more needs to be done to be in a position to test it. Regards afzal