Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5154713rwr; Sun, 23 Apr 2023 22:50:57 -0700 (PDT) X-Google-Smtp-Source: AKy350YXk+P9a1Pg7tqLk6hS3y8GtbjUkfJnz+QcGsGDbIEgvW0moBPpb2UR25GwoZNJc1QKLBkj X-Received: by 2002:a17:90a:688e:b0:22b:b832:d32 with SMTP id a14-20020a17090a688e00b0022bb8320d32mr12100901pjd.9.1682315457212; Sun, 23 Apr 2023 22:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682315457; cv=none; d=google.com; s=arc-20160816; b=V6X+yAhV2y7ogN7DzDkgNRk5mcR+1VmutFIJEpgCJam6CW66YnD3YI0QHVte+tKXxr vuDDcSRWYuyZQbl8Qp9z6j1n3756KmDLsa5L3dbgJsvK7hFdkGrWMTMmQFwzp3RWz7FB 8RtoEhRNcr2yDSFeYCMYt9YgKwjRR3plN6wjWgxi0DbBiYYRgHs2mhCNuJbvOG3YuVX/ LaLMSZ0ZZbIux5xhD3nyfjHY5kk6v3gMyFJMnOznWigo07zyuQq+y0UCBYnML+R8ho7+ ob2NFb+ndrTHGCfnudU6UzHTBg0M1FqaPwEhyi4NrpfUBjCAwGxCc/a4FETJqcN27eC2 icWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=rxuwauPRwLemTJXwY3VrKMRJhs+GgwhnyBD4s7nm7AY=; b=NfISFMPWWz/tW/tOMOQR3x+Y27mohFk1PmwMtq4Kel+KiNYEpMBbKXhCD5uFJJ1cmI vyc0ClO+A9+ZywMysLADe5bGTeTAN5heW1J7QXpEf7Pp503Bm7t4OTjF0QN+R6t3TOtL sB/OEO0NpS0X+5iS6H+tDalPAVZePHHTAP+/Qmcq5fJMyMgeFGCCwmKPyPZd3k5o72h0 /QT1aTLlo/i7Ay/Z/OTYc84kpdZ7bu1mjo6n75rntkPjvLeXIyQmtEG0h1C+X5+yAoju ufiycI0IDa+2G14rgbDw9hOuacmsjJTIVfAo9VwQ/v68FEXXZZ6bBRumzVlHcYslBt/7 8xGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=3MpQEmnJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a17090aad8600b002336940f887si10220147pjq.61.2023.04.23.22.50.44; Sun, 23 Apr 2023 22:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@infradead.org header.s=bombadil.20210309 header.b=3MpQEmnJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbjDXFtt (ORCPT + 99 others); Mon, 24 Apr 2023 01:49:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbjDXFtn (ORCPT ); Mon, 24 Apr 2023 01:49:43 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D5119B3; Sun, 23 Apr 2023 22:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=rxuwauPRwLemTJXwY3VrKMRJhs+GgwhnyBD4s7nm7AY=; b=3MpQEmnJ4id5J1jZ4YFohK5H8q bs7ciFKUIE9sA5F//wk8TThxaPzhLwI6FsUH1vKzNkmpHyq88uhXgF7wTEHMLlqIzGShUjm1tpoQ/ V9Tji0dQSyZQM/K5ekDNoH5faw93KpoQQtAuWkTbvGbcl7apn0KwIYdsbsU9S2n8QH5hFEZJO4yZ5 yp8GdzGRgc1AHk7t7DD60UmLFSqOCfsXJza1GpGtauNVHkVJvJiQUeDviaHbb72Zouz31uRXC/4XE B+bfmZC/bCU0vqPNw8dnGTB4G0skWpel5LUkS6Ua52Z/N1nKMNRb49n9vt5etsldL20AA2wC69Vmq TVA2auLw==; Received: from [2001:4bb8:189:a74f:e8a5:5f73:6d2:23b8] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pqp4s-00FOtV-2G; Mon, 24 Apr 2023 05:49:31 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Miklos Szeredi , "Darrick J. Wong" , Andrew Morton , David Howells , Matthew Wilcox , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: RFC: allow building a kernel without buffer_heads Date: Mon, 24 Apr 2023 07:49:09 +0200 Message-Id: <20230424054926.26927-1-hch@lst.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-nfs@vger.kernel.org Hi all, after all the talk about removing buffer_heads, here is a series that shows how to build a kernel without buffer_heads. And how unrealistic it is to remove the entirely. Most of the series refactors some common code to make implementing direct I/O easier without use of the ->direct_IO method and the helpers based around it. It then switches buffered writes (but not writeback) for block devices to use iomap unconditionally, but still using buffer_heads. The final patch then adds a CONFIG_BUFFER_HEAD selected by all file systems that need it (which is most block based file systems), makes the buffer_head support in iomap optional, and adds an alternative implementation of the block device address_operations using iomap. With this you can build a kernel with block device support, but without buffer_heads. This kernel supports xfs and btrfs as full blown block based filesystems, and a bunch of read-only ones like cramfs, erofs and squashfs. Note that the md software raid drivers is also disabled as it has some (rather questionable) buffer_head usage in the unconditionally built bitmap code. The series is based on Linux 6.3 and will need some rebasing before it can be fed to the maintainers incrementally. All but the last patch definitively seem useful for me. The last one I think is just to avoid introducing new buffer_head dependencies, even if I suspect the real life usefulness of a !CONFIG_BUFFER_HEAD kernel might be rather limited.