Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2495942rwb; Mon, 19 Sep 2022 06:05:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41ziw9UqK57oiQDJD2fqgZQWt0NBFtApdGo7j8EhnxRhxiCNyLH7B1gx93HD7XCamltft+ X-Received: by 2002:a17:907:2c41:b0:779:f8e7:ec32 with SMTP id hf1-20020a1709072c4100b00779f8e7ec32mr12601384ejc.392.1663592700552; Mon, 19 Sep 2022 06:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663592700; cv=none; d=google.com; s=arc-20160816; b=HXbhb+aPzx0q/xR1IPtwWcfbBNfzgix0urY7nOlDNNMsGWy76jhuaomOgTLB16oYPS G4nT+lU8a02zq3HfvvbXkZY+BiE0cDy9TvyMe3RZ8nSDOUrlE2mj8d4XM7Z/MV+kFipU ttuOrlc2u+ExVE6LeaMR1VsNAdlEM6nwcrgeDW2PZCiOEjgWKDU3Zi3nJPQEAqPIOoAF 0/HBbdv6tM6rYCnuSRnr7EZVxRLCikACIbXuWETpeKQ6nfBUa5P0Vh5U8uXmzWtxe3jW dMFCJ0JtpdbDzK+1e8kqRkgIh0YR+1JVaBZjtRu2VUyyvsGM74kAsMWsOhnFljWiabd0 Y2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sCPGjCblCxozW3fTqQ6tvR8NMyzYPs8zVXxVwmmZEGY=; b=QqdjhRF8AY6Trj7zUnxPigFqQkJ+tebCZ3BHxX9WFzRFLLRRFbhnfPlUYK1A/Sj5Ko sQEbYdIkPEOkwXiuylPBx3ZBpSksDMecI0cCbC+sbf2AK653U4Wo12CawaExdvyelKqa 2zBIGDccUHJHY1KmN/oBMSfR7rSIjJAWWsp2NUPkQZru/azRcVVUVdYizmwPz+QerjAJ anf9WgWSVjQzU+OXRmdZfiL3+QD9jo6FhWTuZmUZyIbFB6stzcpmCs9sC/QYs++pnr6j /+1lP5tOQbjLqw8UWhJIHH5+v0srXcEt9MqGNMq+kBOpARA6pqHjm5Rhyui/bhniY1ZT umSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qcJaSM0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa28-20020a1709076d1c00b0077f2779c178si19823915ejc.254.2022.09.19.06.04.29; Mon, 19 Sep 2022 06:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qcJaSM0F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229776AbiISMa1 (ORCPT + 99 others); Mon, 19 Sep 2022 08:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbiISMaZ (ORCPT ); Mon, 19 Sep 2022 08:30:25 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99740167CA; Mon, 19 Sep 2022 05:30:24 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id f20so36559401edf.6; Mon, 19 Sep 2022 05:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=sCPGjCblCxozW3fTqQ6tvR8NMyzYPs8zVXxVwmmZEGY=; b=qcJaSM0FVy1xQ4bUYi6j+61IoL91fS7rTNcrIt/+TiDPxYjiMITF7EPedl7PaPSGe6 gpgbLhcaaqRIIyaN0FjU3Urgls8+a/XgteZOCWH64b9fd43i8YpiL2I8olc2p5Hsbhkk DfDGiWiOpBX1/66+h/gQQu/vYtVVyyeNBXAZdsj10tDctPo1asRcAcE0t9kZE7Dcl+Va kAdWFyTUSbYikT+qRTUOwxWGzSCzO52LsYQEDc1rRfZvYbIWC2v8nrucEWKsw8z11VGq GK8+2qwIrDxo3oQglZVHRbcZ8/gj0ERTtHMprcA3tJbTp986nncU2LHdkXCR05VOPNII 2ERw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=sCPGjCblCxozW3fTqQ6tvR8NMyzYPs8zVXxVwmmZEGY=; b=RBZg2UOaoqHSh7n9uibNq6/2V0XwJjnlBDaXIBk3w7Yw98EIpBpAL0ZCO74XfvdZOx OMvjhiyiJ5P+NqdYupSO1XH++6xqayM7j+0MK1k2gE9LU3YwK4TSbwc8k63XSkoooyaY MXP6i51FyMGSRBORRP+vDgZ6OehXusW4UH54nH6pILAtHGmUV/QtLr5JNUUHE5Cl//t2 J+bXahYOJudrsM8SqrjR5s1D89RgeOu5uY6DBZPqJNyvC+xJjDLDoWPcEr85/STXfp5H fR2ED32YJZVQ4Yjmv3or6aOWgIEYBG6CiAIzX142SpshrPcaCbfIVrxuo2QVG4Pz3JOy wZvQ== X-Gm-Message-State: ACrzQf13pai9VRaCKdD4pVcYOxwq8ufv0wRWUB2sdHP4oHi/vw6aoBEj S5dd7b36s+9yG92gy25FrA== X-Received: by 2002:aa7:cb83:0:b0:443:3f15:84fe with SMTP id r3-20020aa7cb83000000b004433f1584femr15590426edt.17.1663590623084; Mon, 19 Sep 2022 05:30:23 -0700 (PDT) Received: from localhost.localdomain ([46.53.251.91]) by smtp.gmail.com with ESMTPSA id f12-20020a17090631cc00b0077a7c01f263sm15239758ejf.88.2022.09.19.05.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 05:30:22 -0700 (PDT) Date: Mon, 19 Sep 2022 15:30:20 +0300 From: Alexey Dobriyan To: Ivan Babrou Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, linux-kernel , kernel-team , Kalesh Singh , Al Viro Subject: Re: [RFC] proc: report open files as size in stat() for /proc/pid/fd Message-ID: References: <20220916230853.49056-1-ivan@cloudflare.com> <20220916170115.35932cba34e2cc2d923b03b5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 17, 2022 at 11:32:02AM -0700, Ivan Babrou wrote: > > > > * Make fd count acces O(1) and expose it in /proc/pid/status > > > > This is doable, next to FDSize. > > It feels like a better solution, but maybe I'm missing some context > here. Let me know whether this is preferred. I don't know. I'd put it in st_size as you did initially. /proc/*/status should be slow.