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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E211C433F5 for ; Thu, 19 May 2022 08:29:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C766F6B0072; Thu, 19 May 2022 04:29:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C4C4F6B0074; Thu, 19 May 2022 04:29:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B406A6B0072; Thu, 19 May 2022 04:29:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A78C96B0072 for ; Thu, 19 May 2022 04:29:25 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7B7ED3229B for ; Thu, 19 May 2022 08:29:25 +0000 (UTC) X-FDA: 79481818290.05.DD5602A Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf31.hostedemail.com (Postfix) with ESMTP id B2ED62000C for ; Thu, 19 May 2022 08:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=Ukgjfu0f07JgF+7rcTkChhLVf35mD3VwAQNSxB4A74c=; b=2KsfGfpBAN8e+UBrmZruBq76Tu x2U73Zz1wCon4mBRYPPzJ38EWfWDfvzCcBhxN3vO5HlesTL9E+oewS9884wzkyXHJdJx6pTTSPEJY DaZQxpVroYYwx0qowINv1zkaDqI4EKbuRwxaY94yWXlCTU1d9LBRbCWJB6zMulSski5lEtMbg6wlS i5LGqDPAMfdytAWVUpqKkddZMcDzrr3289Y6YRi2utDeEVEZnFRdhMdeDaRGH5L1dXIpzrgUFfH8C sq5S7ODU+BN1l25ErPtqL4BcFhBlyqNPMHqJwx/WRV62pBuBRl7fLekjh6gFs4/fNB+V2j7Feovmp I5kbQTug==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrbX8-005qpl-14; Thu, 19 May 2022 08:29:22 +0000 Date: Thu, 19 May 2022 01:29:21 -0700 From: Christoph Hellwig To: Stefan Roesch Cc: io-uring@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, david@fromorbit.com, jack@suse.cz Subject: Re: [RFC PATCH v3 15/18] mm: Add balance_dirty_pages_ratelimited_async() function Message-ID: References: <20220518233709.1937634-1-shr@fb.com> <20220518233709.1937634-16-shr@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220518233709.1937634-16-shr@fb.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B2ED62000C Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=2KsfGfpB; spf=none (imf31.hostedemail.com: domain of BATV+015a865715d1323b7cbd+6843+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+015a865715d1323b7cbd+6843+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Rspam-User: X-Stat-Signature: ikppgb86um5q8j7mcfmwihpr8es98yyt X-HE-Tag: 1652948935-97294 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: > +static int balance_dirty_pages_ratelimited_flags(struct address_space *mapping, > + bool no_wait) > { This doesn't actully take flags, but a single boolean argument. So either it needs a new name, or we actually pass a descriptiv flag. > +/** > + * balance_dirty_pages_ratelimited_async - balance dirty memory state > + * @mapping: address_space which was dirtied > + * > + * Processes which are dirtying memory should call in here once for each page > + * which was newly dirtied. The function will periodically check the system's > + * dirty state and will initiate writeback if needed. > + * > + * Once we're over the dirty memory limit we decrease the ratelimiting > + * by a lot, to prevent individual processes from overshooting the limit > + * by (ratelimit_pages) each. > + * > + * This is the async version of the API. It only checks if it is required to > + * balance dirty pages. In case it needs to balance dirty pages, it returns > + * -EAGAIN. > + */ > +int balance_dirty_pages_ratelimited_async(struct address_space *mapping) > +{ > + return balance_dirty_pages_ratelimited_flags(mapping, true); > +} > +EXPORT_SYMBOL(balance_dirty_pages_ratelimited_async); I'd much rather export the underlying balance_dirty_pages_ratelimited_flags helper than adding a pointless wrapper here. And as long as only iomap is supported there is no need to export it at all.