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 C480FC433EF for ; Wed, 4 May 2022 16:55:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FFCE6B0071; Wed, 4 May 2022 12:55:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AF2B6B0073; Wed, 4 May 2022 12:55:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09F4A6B0074; Wed, 4 May 2022 12:55:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EE6E36B0071 for ; Wed, 4 May 2022 12:55:39 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C40D260F12 for ; Wed, 4 May 2022 16:55:39 +0000 (UTC) X-FDA: 79428661998.18.E7718A5 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id D4A5940083 for ; Wed, 4 May 2022 16:55:34 +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=Vxwk6Ijca/aYX+YfbJBlvvvvNjiuUacuBmt+5rQYXNM=; b=oDQFuDC/CbyMdA5t8SUc6eRJ5k GEy0MMahpBfiLT+xl7o9H01Qis311BLD46CZS9dMm7n5XRUJFMaXMXzkClGlxtydgQr54gPBNVGt9 8nD5LiI1/nxKXZJJV/mUAuquq7yTPIrQ/W+3+CbW8U6WzHb00I8BssP90tik+BOuze4dVKJeJ3+wm t/BswQz/9H3KUGwY5SXMVPasHKpjQ+zM1t+wrjYHk3qlbRQhjX2iG13ZM+u4oPBj95KXNxtVD6tfy Aylv4xN3syksY8sOchC55gU3Snt3/+JrP2ZgG+FcoXg8brg/Pyx4gpwLgwo6ibQIgGlSTiGE9q5Rv oxXvVO9w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmIHl-00GkfM-On; Wed, 04 May 2022 16:55:33 +0000 Date: Wed, 4 May 2022 17:55:33 +0100 From: Matthew Wilcox To: Minchan Kim Cc: Andrew Morton , LKML , linux-mm , Suren Baghdasaryan , Michal Hocko , John Dias , Tim Murray Subject: Re: [PATCH] mm: don't be stuck to rmap lock on reclaim path Message-ID: References: <20220503170341.1413961-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="oDQFuDC/"; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D4A5940083 X-Stat-Signature: p567om6sckuxafyroc1e4quq8pszbmzd X-HE-Tag: 1651683334-708997 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000101, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 04, 2022 at 08:52:13AM -0700, Minchan Kim wrote: > On Wed, May 04, 2022 at 07:09:37AM +0100, Matthew Wilcox wrote: > > On Tue, May 03, 2022 at 09:30:38PM -0700, Minchan Kim wrote: > > > On Wed, May 04, 2022 at 04:32:13AM +0100, Matthew Wilcox wrote: > > > > On Tue, May 03, 2022 at 10:03:41AM -0700, Minchan Kim wrote: > > > > > -void rmap_walk(struct folio *folio, const struct rmap_walk_control *rwc); > > > > > -void rmap_walk_locked(struct folio *folio, const struct rmap_walk_control *rwc); > > > > > +void rmap_walk(struct folio *folio, struct rmap_walk_control *rwc); > > > > > +void rmap_walk_locked(struct folio *folio, struct rmap_walk_control *rwc); > > > > > > > > I see the build bot already beat me to pointing out why this is wrong, > > > > but do you not look at git log to figure out why code was changed to be > > > > the way it is now, before you change it back? > > > > > > This patch added a new field as out param like compact_control so > > > the rmap_walk_control is not immutable. > > > > ... but we have a user which treats it as if it is. > > True. I don't think it will show sizable benefit on runtime overhead > since rmap_walk is already one of the most expensive operation in MM. > > I could reintroduce the typecast for page_idle_clear_pte_refs to remove > the const as we had several years. > > If your concern was to make rmap_walk_control mutable back, I could > change rmap_walk function having return value or adding a addtional > new out param. However, I thought rmap_walk_control is more readable/ > easier than them. I haven't thought deeply about it, but I suspect the right approach is to remove the rather dubious optimisation in page_idle_clear_pte_refs().