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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 57479C433E0 for ; Fri, 29 May 2020 20:57:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 333FE208B8 for ; Fri, 29 May 2020 20:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590785877; bh=h0SqLi+xBFWQEmb4/Rl36hRoBrcqcjYMRAqOeU1+XiQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=hN89w0QqV3NVE95s93v5Q5zDL2E24TwaHAh1M6cJB+LftKFkVHNYEfXElLKuyu5TR BlXYCgMsfaMqF20r9/YCz7NBRYe1vXK8MzGkXDgoyhjiccp54jjMyOSeoMZX/smTMb 2oLDqPoGfhXfL1iS9gHnnZBeZ9V7H1WM66Wt05lg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728164AbgE2U54 (ORCPT ); Fri, 29 May 2020 16:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbgE2U54 (ORCPT ); Fri, 29 May 2020 16:57:56 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB440C03E969 for ; Fri, 29 May 2020 13:57:55 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id c12so491390lfc.10 for ; Fri, 29 May 2020 13:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XMYB1DtpdiIUC5Hq3/MKsg9W34brhT1SCCn+MooLpt8=; b=WOJNDSngSwvWbLC2sXGabc4EsYy/SY5WCyG2Wcz4ga+pMjXDofuGha/vYFN9lzucI/ nJ5ARc+8aqxDiqUOr0euKYd9U3Oe8PMKryjwX6vi0gvtIqx6Hr/BTyDvR/9dLvYzMajO qg5gVi+OH0yIvezUJoOvXcjcwZOZR02jRQ5Rs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XMYB1DtpdiIUC5Hq3/MKsg9W34brhT1SCCn+MooLpt8=; b=iR/iJjz91zr10mkYrvLmuL2tw55iRN/b5NWrtljvSZ6HxxsYblwUbhYJ0+6/Z0+TMM fIMDkFX+XTDg6V6a8x40X0ploHGVMrExYtLjItrXx9wIaEqaMAx0GFr8C3bfUfh3Yc+2 BEEUw54N94ffa1r8Elw1QE7OXcQS2T8oGEdE0//2ajG4+boGEC7xxqsj08gT5D71BfPT InG9VSyVyZOhAPHseL+6uHYmppwYcE1ay7IVShRPyX6Rur8pu5XpdLoIE3vI481UhicB 2BVHuErftCIae3bxEe5NBBS+w3pLtDfETsdBd2BZ99xOvMOc55ts/jho71RzJnS8Pmt2 3BaQ== X-Gm-Message-State: AOAM532+ic/GSVOrnUXdry6iKyo6PtLiy/aDIxlQcCz7YFIHBgJSOUPu MMCoN4BcgG9shgVyecq9+pmhzgKqi48= X-Google-Smtp-Source: ABdhPJzKtTOO9101DYj6SnA5LlXecualpW+I8bTSjqHISj/WA5QQxKK9DmWQwGpyAkCn2H9BMawOsQ== X-Received: by 2002:a19:8313:: with SMTP id f19mr5477504lfd.207.1590785873787; Fri, 29 May 2020 13:57:53 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id s13sm2863646lfp.81.2020.05.29.13.57.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 May 2020 13:57:53 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id 82so521586lfh.2 for ; Fri, 29 May 2020 13:57:52 -0700 (PDT) X-Received: by 2002:ac2:504e:: with SMTP id a14mr5417023lfm.30.1590785872566; Fri, 29 May 2020 13:57:52 -0700 (PDT) MIME-Version: 1.0 References: <20200529000345.GV23230@ZenIV.linux.org.uk> <20200529000419.4106697-1-viro@ZenIV.linux.org.uk> <20200529000419.4106697-2-viro@ZenIV.linux.org.uk> <20200529014753.GZ23230@ZenIV.linux.org.uk> <20200529031036.GB23230@ZenIV.linux.org.uk> <20200529204628.GI23230@ZenIV.linux.org.uk> In-Reply-To: <20200529204628.GI23230@ZenIV.linux.org.uk> From: Linus Torvalds Date: Fri, 29 May 2020 13:57:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] dlmfs: convert dlmfs_file_read() to copy_to_user() To: Al Viro Cc: Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, May 29, 2020 at 1:46 PM Al Viro wrote: > > Umm... I'd been concerned about code generation, but it actually gets > split into a pair of scalars just fine... We actually have depended on that for a long time: our 'pte_t' etc on 32-bit kernels were very much about "structs of two words are handled fairly well by gcc". IIrc, we (for a while) had a config option to switch between "long long" and the struct, but passing and returning two-word structs ends up working fine even when it's a function call, and when it's all inlined it ends up generating pretty good code on just two registers instead. > Al, trying to resist the temptation to call those struct bad_idea and > struct bad_idea_32... I'm sure you can contain yourself. > All jokes aside, when had we (or anybody else, really) _not_ gotten > into trouble when passing structs across the kernel boundary? Sure, > sometimes you have to (stat, for example), but just look at the amount > of PITA stat() has spawned... I'd rather see the struct than some ugly manual address calculations and casts... Because that's fundamentally what a struct _is_, after all. Linus