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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21919E77345 for ; Fri, 29 Sep 2023 22:24:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232834AbjI2WYa (ORCPT ); Fri, 29 Sep 2023 18:24:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjI2WY3 (ORCPT ); Fri, 29 Sep 2023 18:24:29 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4E2A1A8; Fri, 29 Sep 2023 15:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=N4F2QfXt0qCvJT+KbS3ZaeUVFr/M0rdBm91MXelB3ww=; b=Nj8Q+hBv5VWBtOtoQ2qjL5pO5Z UzC6KFuZP4qUCUCH8d+zuiytkGx9+IrACFoQLP9WinUO46iUBl8P1jjmuogqeBDRUIC2uQyb7xckY XnANjE/5B2paNEFkfzos6qypBuSRDTW1ohstRa59pshV+T3ihWQSPE7/2WxYmKysGU6iOM4GbdxMK kLb9kNK8nVA9YmYIw6hWWZiGYVFWU4qn0NHbpFMmfWF9c3mIAY3nrV3uujoF6F2x2QM+Sb2Yg1gaa RpMhboXmDEies74dLbUPrekbZPPYK5sRynRUHL2+sSVenmvv0whk57ag+nsIJRw3HFSFwOQ5pBxAh aTeTFvMw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qmLuE-00BIgB-NK; Fri, 29 Sep 2023 22:24:18 +0000 Date: Fri, 29 Sep 2023 23:24:18 +0100 From: Matthew Wilcox To: Mateusz Guzik Cc: Christian Brauner , Jann Horn , Linus Torvalds , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] vfs: shave work on failed file open Message-ID: References: <20230928-kulleraugen-restaurant-dd14e2a9c0b0@brauner> <20230928-themen-dilettanten-16bf329ab370@brauner> <20230929-kerzen-fachjargon-ca17177e9eeb@brauner> <20230929-test-lauf-693fda7ae36b@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Sep 29, 2023 at 11:23:04PM +0200, Mateusz Guzik wrote: > Extending struct file is not ideal by any means, but the good news is that: > 1. there is a 4 byte hole in there, if one is fine with an int-sized counter > 2. if one insists on 8 bytes, the struct is 232 bytes on my kernel > (debian). still some room up to 256, so it may be tolerable? 256 isn't quite the magic number for slabs ... at 256 bytes, we'd get 16 per 4kB page, but at 232 bytes we get 17 objects per 4kB page (or 35 per 8kB pair of pages). That said, I thik a 32-bit counter is almost certainly sufficient.