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.2 required=3.0 tests=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 2F5C3C10F14 for ; Tue, 8 Oct 2019 05:02:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FD702084D for ; Tue, 8 Oct 2019 05:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729717AbfJHFCk (ORCPT ); Tue, 8 Oct 2019 01:02:40 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:51206 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbfJHFCk (ORCPT ); Tue, 8 Oct 2019 01:02:40 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iHhdu-0002fc-EL; Tue, 08 Oct 2019 05:02:38 +0000 Date: Tue, 8 Oct 2019 06:02:38 +0100 From: Al Viro To: Linus Torvalds Cc: Guenter Roeck , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH] Convert filldir[64]() from __put_user() to unsafe_put_user() Message-ID: <20191008050238.GS26530@ZenIV.linux.org.uk> References: <5f06c138-d59a-d811-c886-9e73ce51924c@roeck-us.net> <20191007012437.GK26530@ZenIV.linux.org.uk> <20191007025046.GL26530@ZenIV.linux.org.uk> <20191008032912.GQ26530@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Oct 07, 2019 at 09:14:51PM -0700, Linus Torvalds wrote: > On Mon, Oct 7, 2019 at 9:09 PM Linus Torvalds > wrote: > > > > Try the attached patch, and then count the number of "rorx" > > instructions in the kernel. Hint: not many. On my personal config, > > this triggers 15 times in the whole kernel build (not counting > > modules). > > So here's a serious patch that doesn't just mark things for counting - > it just removes the cases entirely. > > Doesn't this look nice: > > 2 files changed, 2 insertions(+), 133 deletions(-) > > and it is one less thing to worry about when doing further cleanup. > > Seriously, if any of those __copy_{to,from}_user() constant cases were > a big deal, we can turn them into get_user/put_user calls. But only > after they show up as an actual performance issue. Makes sense. I'm not arguing against doing that. Moreover, I suspect that other architectures will be similar, at least once the sigframe-related code for given architecture is dealt with. But that's more of a "let's look at that later" thing (hopefully with maintainers of architectures getting involved).