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=-8.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 DEA00C49EA6 for ; Thu, 24 Jun 2021 18:21:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8080C613B1 for ; Thu, 24 Jun 2021 18:21:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8080C613B1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 47DC96B0036; Thu, 24 Jun 2021 14:20:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 42E446B005D; Thu, 24 Jun 2021 14:20:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31C956B006C; Thu, 24 Jun 2021 14:20:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 003E96B0036 for ; Thu, 24 Jun 2021 14:20:58 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2E96422891 for ; Thu, 24 Jun 2021 18:20:59 +0000 (UTC) X-FDA: 78289433838.11.4510B22 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 918BF4202A19 for ; Thu, 24 Jun 2021 18:20:58 +0000 (UTC) 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=FH58xbrAwnxp9hbQL1JpxcH4bv5YM22KZsRyy+S8dEs=; b=YXqz0TXHOCWa6ql73OknL7qcpu T/RTjbrYcp1ojPjkshOCBVrzKQgVb5jW8R+PMHj556bZ0hjNXhLN9MoTT+xXLRrE95rePCVRwL2Xc kcfA82jkjqVOoZtwkASo5sLPdjuLMowOJRlGT25vBlHqhd2BDs5V760Nkceh+KKij/SDNUEQ5XHb/ 3TAUBHPgMKcFLzRMt4I9ciyUCVvQc3NewukF3/Ks9EiWIeC/Bp1YCgS1QxAH6kORlg2NMhJFnbL4W mstIH0MKdVfvqaZhzQdeCANysHUP0IaxoltuzpYc8AquxLGP/wYWMIV11GhiDSj2S40nBONt8ClvA d2AAfOzQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwTxU-00GryO-PM; Thu, 24 Jun 2021 18:20:25 +0000 Date: Thu, 24 Jun 2021 19:20:12 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 24/46] mm/writeback: Add __folio_end_writeback() Message-ID: References: <20210622121551.3398730-1-willy@infradead.org> <20210622121551.3398730-25-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YXqz0TXH; dmarc=none; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: icksa85mc1pjefm643iei3tzr3rmu6k7 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 918BF4202A19 X-HE-Tag: 1624558858-75541 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 23, 2021 at 11:15:55AM +0200, Christoph Hellwig wrote: > On Tue, Jun 22, 2021 at 01:15:29PM +0100, Matthew Wilcox (Oracle) wrote: > > test_clear_page_writeback() is actually an mm-internal function, although > > it's named as if it's a pagecache function. Move it to mm/internal.h, > > rename it to __folio_end_writeback() and change the return type to bool. > > > > The conversion from page to folio is mostly about accounting the number > > of pages being written back, although it does eliminate a couple of > > calls to compound_head(). > > While this looks good, I think the whole abstraction is wrong. I think > test_clear_page_writeback should just be merged into it's only caller. I'm not opposed to doing that, but something else has to get un-static'ed in order to make that happen. folio_end_writeback (exported, filemap.c) -> folio_wake (static, filemap.c) -> folio_wake_bit (static, filemap.c) -> __folio_end_writeback (non-static, page-writeback.c) -> __wb_writeout_add (static, page-writeback.c) I'm not sure there's an obviously better split than where it is right now. > But if that is somehow not on the table this change looks ok: > > Reviewed-by: Christoph Hellwig