From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC][CFT][PATCHSET v1] uaccess unification Date: Thu, 30 Mar 2017 19:48:24 +0100 Message-ID: <20170330184824.GS29622@ZenIV.linux.org.uk> References: <20170329055706.GH29622@ZenIV.linux.org.uk> <20170330162241.GG7909@n2100.armlinux.org.uk> <20170330164342.GR29622@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:53434 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933891AbdC3Ssv (ORCPT ); Thu, 30 Mar 2017 14:48:51 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Linus Torvalds Cc: Russell King - ARM Linux , "linux-arch@vger.kernel.org" , Linux Kernel Mailing List , Richard Henderson , Will Deacon , Haavard Skinnemoen , Vineet Gupta , Steven Miao , Jesper Nilsson , Mark Salter , Yoshinori Sato , Richard Kuo , Tony Luck , Geert Uytterhoeven , James Hogan , Michal Simek , David Howells , Ley Foon Tan , Jonas Bonn On Thu, Mar 30, 2017 at 10:18:23AM -0700, Linus Torvalds wrote: > This is all going in the wrong direction entirely. This is not going into the tree - it's just a "let's check your theory about might_fault() overhead being the source of slowdown you are seeing" quick-and-dirty patch. Speaking of the checks in there - if anything, might_fault() in those suckers belongs outside of the loop; note that even on the kmap_atomic() side of copy_page_to_iter_iovec() we do stuff like fault_in_pages_writeable(). BTW, ..._inatomic is a very unfortunate name, IMO - it's *not* safe to use in atomic contexts as-is, to start with; the caller needs to take care of pagefault_disable(). If anything, __copy_from_user_nofault() would probably be better... I really wonder about the low dispersion in those tests - IME on amd64 boxen it tends to be ~5% or so; what's normal for arm? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:53434 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933891AbdC3Ssv (ORCPT ); Thu, 30 Mar 2017 14:48:51 -0400 Date: Thu, 30 Mar 2017 19:48:24 +0100 From: Al Viro Subject: Re: [RFC][CFT][PATCHSET v1] uaccess unification Message-ID: <20170330184824.GS29622@ZenIV.linux.org.uk> References: <20170329055706.GH29622@ZenIV.linux.org.uk> <20170330162241.GG7909@n2100.armlinux.org.uk> <20170330164342.GR29622@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Linus Torvalds Cc: Russell King - ARM Linux , "linux-arch@vger.kernel.org" , Linux Kernel Mailing List , Richard Henderson , Will Deacon , Haavard Skinnemoen , Vineet Gupta , Steven Miao , Jesper Nilsson , Mark Salter , Yoshinori Sato , Richard Kuo , Tony Luck , Geert Uytterhoeven , James Hogan , Michal Simek , David Howells , Ley Foon Tan , Jonas Bonn , Helge Deller , Martin Schwidefsky , Ralf Baechle , Benjamin Herrenschmidt , Chen Liqin , "David S. Miller" , Chris Metcalf , Richard Weinberger , Guan Xuetao , Thomas Gleixner , Chris Zankel Message-ID: <20170330184824.0e64l-eYk4OvkiARanzo38D9uy5GrHzlvu6m2YnZI0E@z> On Thu, Mar 30, 2017 at 10:18:23AM -0700, Linus Torvalds wrote: > This is all going in the wrong direction entirely. This is not going into the tree - it's just a "let's check your theory about might_fault() overhead being the source of slowdown you are seeing" quick-and-dirty patch. Speaking of the checks in there - if anything, might_fault() in those suckers belongs outside of the loop; note that even on the kmap_atomic() side of copy_page_to_iter_iovec() we do stuff like fault_in_pages_writeable(). BTW, ..._inatomic is a very unfortunate name, IMO - it's *not* safe to use in atomic contexts as-is, to start with; the caller needs to take care of pagefault_disable(). If anything, __copy_from_user_nofault() would probably be better... I really wonder about the low dispersion in those tests - IME on amd64 boxen it tends to be ~5% or so; what's normal for arm?