Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp970361ybt; Sun, 14 Jun 2020 06:09:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7fCqrifk+FacNXiCYUChPT+I+lznp7u+gM55uI8pjRxrfphlism6EybbOdWOGCRYSgFNy X-Received: by 2002:a50:af25:: with SMTP id g34mr19908315edd.85.1592140190408; Sun, 14 Jun 2020 06:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592140190; cv=none; d=google.com; s=arc-20160816; b=NC5xrAtN2/2eFb521NWYUOkq+731fykEpychh2HGvH7ugdf14cQ83C+4dZZZM3/J/0 Rh3L7hdEDpD9LmxE1yJKXdCs6YvBj5QAgOBWkNZ1eDKbWgGIWI2m2MpcWMwd/g2kvcTa jWaNoPDYx1hq9W024+Jrcdz7up9gdYtyInpkk2XGpMI+s5X0XRGXNFd9Rlqx9oM6eATd Gh38PWi7vT9RSfg94pfqjsLk9yR3IpaX7YXukosl52cFsDZzhTQuvCqPTXOakmRkkJPa kfIleZxLEmDNxR/ffsHEagsWZ6y6e7UDiFGaSQ3S4hp+imMLfjcEH/Sh96rGCOE7erkw zZrQ== 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=tbNPHbcJdd9Zy5vpitc4It2x0QhJhg6ckwY09//qr6Y=; b=Ll7aOQj07h5kimy7yRDZioG8xha4U6Gol7WxCG1CqtkF5b/AqNXbNoWnPMAMQgyAg+ m1y/eTvlM+STBJu5xlclGjx6a3jAkrs8+hrRqOURAZwAllbTCZCxmDA8QrUK49mLsvLG HC3gk/a8qsG4T8gJfM1hMI0LQWubR+jd7J0M0KJQVr524lSftI+RRFBb8RKiUrPR+GhX gfIo9sFR3rqYwVuPbmAJ+lg2n3kPCjJt2nDXxC9EiifyVqlG46HrGyTr++X84MHQbldg XXZyEJ5Zcgbvza9Wd37uSlG9N4XM8QLIruFb1dtoV1H997i6ihnQOGMG6WUf2SaO9prB FGKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=onBIBYT4; 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 b4si7224723ejp.577.2020.06.14.06.09.28; Sun, 14 Jun 2020 06: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=onBIBYT4; 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 S1727779AbgFNNGj (ORCPT + 99 others); Sun, 14 Jun 2020 09:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbgFNNGi (ORCPT ); Sun, 14 Jun 2020 09:06:38 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E22C05BD43 for ; Sun, 14 Jun 2020 06:06:38 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id 10so6586848pfx.8 for ; Sun, 14 Jun 2020 06:06:38 -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=tbNPHbcJdd9Zy5vpitc4It2x0QhJhg6ckwY09//qr6Y=; b=onBIBYT4ViSU7ygp5zYYYBkpUleSF5iOdLkVHxQBdUzs6HwG5FPU2AJIL94jiO1/3q e611vI3yaKJGxZt2s4y6snRpXKvWJq8OqYUJjwVNmgfG7HHqxMRpPNskzZb5sxAjWHjY xnRzeKS3IREF5B9/QGpTyAwqFLQY/nYBHWJAnL9xC8VVruuUd86ny7YZy0CwYO06X5JA S87sPGgfHf0Of2/wEO3Lf7D81x16zacDo1gKx/WP3icE0P4D0ZRLXudAyfnGbhm2eAFX FoESIv6H9gYq4R8Kg1xRHUcUxg6EpkTgR8UX8haSscXC6Q7aRYqatXBg5s4wlT6QdIlv AbXg== 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=tbNPHbcJdd9Zy5vpitc4It2x0QhJhg6ckwY09//qr6Y=; b=QLnB8mKHCRFyB7jYz2fReiUJCi/xq62JBBs+Ljaxtc2I8cHr13AlYztdh/HiP7P+/C q8K4ZKUOyHfN7c0GoQ96BsvTZbA5RZlBG50U6V836hzwuiYjTEp02GhKWFVnAgbYmfO1 pef3ROmdJfG9Yp/XY0JhyZwG75TzFSD6Agx6WGtvPaIPgpWckW6anHm0mDKkzOOCcoEa u8JgHhaLWtOU0JMKyvbcuyfwJgdq44pFvBFTi+poXMNey9TxvbgoQh3GCIunTMfeBhdx oiKpp/D2AGbabBIMzgv3Bn5rGSGu+1bdsMM11T/jPM91CC+VHCEqD6iRP7Z/QjZ6TptU MO+w== X-Gm-Message-State: AOAM531FNUA6cyDPx9VsNLtp8KLlJjunlMSEkmvJQIQYj0h39qHFoQ5i FT8h1y3wvXNskk4O2mH7muM= X-Received: by 2002:a63:4861:: with SMTP id x33mr109880pgk.448.1592139997958; Sun, 14 Jun 2020 06:06:37 -0700 (PDT) Received: from localhost ([49.207.199.244]) by smtp.gmail.com with ESMTPSA id y10sm9811760pgi.54.2020.06.14.06.06.37 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Jun 2020 06:06:37 -0700 (PDT) Date: Sun, 14 Jun 2020 18:36:35 +0530 From: afzal mohammed To: Russell King - ARM Linux admin 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: <20200614130635.GA5037@afzalpc> References: <9e1de19f35e2d5e1d115c9ec3b7c3284b4a4e077.1591885760.git.afzal.mohd.ma@gmail.com> <20200612135538.GA13399@afzalpc> <20200613120432.GA5319@afzalpc> <20200613131552.GL1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200613131552.GL1551@shell.armlinux.org.uk> 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 Sat, Jun 13, 2020 at 02:15:52PM +0100, Russell King - ARM Linux admin wrote: > On Sat, Jun 13, 2020 at 05:34:32PM +0530, afzal mohammed wrote: > > i think C > > library cuts any size read, write to page size (if it exceeds) & > > invokes the system call. > 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 Okay. Yes, observed that dd is passing whatever is the 'bs' to Kernel and from the 'dd' sources (of busybox), it is invoking read system call directly passing 'bs', so it is the tmpfs read that is splitting it to page size as mentioned by Arnd. Regards afzal