Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp303933ybt; Sat, 13 Jun 2020 05:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx88kLl706v2yd3Hs/Qk6k9N4nkBq9Vu6+umSEvy3+vcC6SvtUL7YMVL7ct3UZQbfEhaNwx X-Received: by 2002:a17:906:f115:: with SMTP id gv21mr16836760ejb.340.1592050190136; Sat, 13 Jun 2020 05:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592050190; cv=none; d=google.com; s=arc-20160816; b=tE/GNOSVcrY9VVDmD/nrFO9PMV67poqljVoWI8gyJCJ0T/oGqePfvVsv4YN3K7Mzzr fNYDOnyZJa8RbkKeyQKmWaJCkY4n6qqTeRMTRmy8opfmtJ4y+fPFwlu4clZd28mUsRWt n3neD8VFMFfZrfNdOqbW9I5DWpCvVhMmqPj5S8Edwd9pUndVZNMJg4dBsI3gXTGhkZyR qfjof80YzYUEJ4kWLrV6El8hUejGnsCr+1Zx7rHY/Iomfwi8ESeb5C5cm7nlSRsCulhf Z8xq77u4AheMEUWXEKT7SFnL3YTmbkBrBRH+dzmG5ILcqord1RWkegSkTqXlcRZqsNHV XonQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LBrsfxO25w2eu+lrtvfG2KxIdSA+88lYE5tWiAEH8qM=; b=N1dnjAoaQHP8mGaiSfETp2R+8gBwn8854zoaqZynWuMQY9gXoUkurBXCDQG1nIuG7T 0phy70ojctuHZUVeuZuHzLD4pwcCC34OYf+mAgQt+odhZMj6PTdpzutengqClew2ScR7 6hL3zuVGcMUXTwyW+NKjW5/uj17s0PQu+1rD/Vvh/aE/nzpfyJkM8FUYwsylbxovmn6V +lImlExqYRB6GXHRYrVt8IbarPW94k6UERpu4bQbqwiBQYjb9HhEVSEpJe3DBFJoj1Jv nQ4wArMMzfJCYwQMmZx2E+SbcsROZPUMU+XjtN+EeBVFCWs+I9mcF0i2d7a2BUAG4avG bNeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CU6y3HBb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si5603440ejx.374.2020.06.13.05.09.28; Sat, 13 Jun 2020 05:09:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CU6y3HBb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbgFMMEi (ORCPT + 99 others); Sat, 13 Jun 2020 08:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726021AbgFMMEh (ORCPT ); Sat, 13 Jun 2020 08:04:37 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DAE5C03E96F for ; Sat, 13 Jun 2020 05:04:36 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 64so5578632pfv.11 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=ac4KVPLccg0CX/VxNi1EnYiBLhuAmE0YuOinGWfZ+PD/NAXiQctxzz0Yl2cRhRNRR2 6+mMdh2QDTLD1nKXMEZ4u/j80j72/WqeVlZdMlrAfjzighYI9Rw0NBu55vtjsBF/iLPT m5HvFq7Sp4Fy5/t7+dW2CQc/TFGeHf8Y0TkdG10Pw7BEWgk7QoeCcBKEicSvJfxdH3b1 rwiZn2FokYIWmVxD3rczFUREJl1ubDJTo7/NPX4xOz+GQsYiB/9E0dju7D2pruwrwR4M ojF06AtWm4/CgQmdiY1cSNbWRx7YV91fRg8cXVyWX8SwJdI/TKClLPATE9JbGwFAkl+l gV0g== X-Gm-Message-State: AOAM533qPfuk4U0T1IG1sbTqPZxRmlTyZqvu+iuFaqSdzKs5AiZEZ0lq x8l4fPnLFSS+t9vu3M7A0vo= 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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