Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5196168ybp; Mon, 7 Oct 2019 22:06:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXjkjDhabNBvMxx6aRnROVFHqBgQk6knuhuZhjmDoDzb7AxViAJvSNzk7K7gkG7QL3Q63N X-Received: by 2002:a17:906:7499:: with SMTP id e25mr19107366ejl.326.1570511203960; Mon, 07 Oct 2019 22:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570511203; cv=none; d=google.com; s=arc-20160816; b=Upknvzh/PLXcMmknronjWkQEQCVMwmcUcQz//JZKLLz6U1irIi6m/MEuNl1g4Pbc4w Yls2q7ctDoQvEpYrHyX+Q/dPXF6OdHAdYSEZdORXW5JuoqG4tTjAOCY9Ncp8VJzCY5l7 3g3ssBkrtCVf5w+cfYa3ucOP/dAD8tEFykLrmtHWO/w6ec5cRS0ZC/nwmSdTqJnjNSPZ 4/RJ11b9HLWvajUjnZypHgPxak6ElbckqYDntw/p97RIMzTAbLGzNFjEm0/mj6MD4gsA mJcin01zTM44W1MNU6OduORshed4wXg8B4PtsuKaFw1HDqKmbpSyCtmcATcK0GyHJLqD FrRw== 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; bh=AXGb7UPxq3cp58thc7MoNImCH6Cht3oQLp6m2m8Cgs8=; b=Ep2C7GB81dXcJ7z9qDK4o378ujzP4q9MDYyNLudfazNZUluuTc5GH5qEgm4OxZnJML BQeeE894ZCKhdZdZcZ5OfL/cgcl3SXGrjJ7Neh0ogTZnvjiyjhc8SPn/XM8YvZMJZbGc xbIfAqLmEQTvYm+5J6UKRkccpMfCC6aA3BeRJKhwZlgr7cpw822xGgGQwGX/203ZG+wQ 1dCzvO3YfO0m6UI/heuuYCoOgx1NB5nf0gZHlq5LOa+VawYPEfxbNg/63rFOEexvpyZs N4zuuDfmBQUgwrx8vKmy/fNIOX2D1lRxablh/v/kgW6NWOkbbOwrvqUvqyEDcNinkjoz 89SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si10516775ede.150.2019.10.07.22.06.18; Mon, 07 Oct 2019 22:06:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729750AbfJHFCk (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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).