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 71276C433F5 for ; Wed, 4 May 2022 15:52:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 816DB6B0071; Wed, 4 May 2022 11:52:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C38C6B0073; Wed, 4 May 2022 11:52:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B2536B0074; Wed, 4 May 2022 11:52:17 -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 5CE316B0071 for ; Wed, 4 May 2022 11:52:17 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B94BEDA for ; Wed, 4 May 2022 15:52:17 +0000 (UTC) X-FDA: 79428502314.22.13DEE88 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by imf30.hostedemail.com (Postfix) with ESMTP id D96B980095 for ; Wed, 4 May 2022 15:52:03 +0000 (UTC) Received: by mail-pg1-f180.google.com with SMTP id v10so1468453pgl.11 for ; Wed, 04 May 2022 08:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pMc4HZgJ4WDMVFUKNjkRSvRoarYOHBjdOLFJ+JcudJE=; b=LTFB1OjUJGw2zg2beDtYujBQvuumELokvnv1zDT+PhJ6LeTj+U6IC9xuWxKPXkw8g1 kR4qRhQLHvovhB0GiRTORcQ6pIueUYhxQmIvBxyqViRuwpr/92BSnGuLFQvLT7oHcd9Q hZEOyqJmkXTqwrPI7fP0UcOa8fzNg+dyYeua4Znhp3qaWkF30trSKGXfRR3bbCJd2Oob yyYYL924NUecwfSFyiqv3fiAUuvKq3lonOJvda9fAuCgmx5ANlcGt7NyjXBRpJmsJBZf 1mGiYbZr5BPLlQ5v2vqvd8bfg5hPJSDUBqq1Z192ymgpx5XmHsWkddkn4FX3358qsVn5 R9TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=pMc4HZgJ4WDMVFUKNjkRSvRoarYOHBjdOLFJ+JcudJE=; b=lz7xUhxuOZYfqZxuQ/wnlUbkG0lFclNniY99pJPeeu9jy+y0cDxQR/TcSOzDwjrRRv eoIKMRycd1w0gnP43GilL9ZcRnYruWlYiPtADenMVV0hcn0ENcKaPHaNLXKFQEwBZyv1 kl6qY1jxCUMxpiUJQhDISB8AUJzLTRbk4kfOc5J3dgywwJ8TZFWUCWSZgWxt4cnTrveR tf7xoTQs9Y63M0rzHkRm6r8WKP3bSZbuesOEy+wxQVh6VhDJreYdZA3Qo/wI0oCTMnei qxsKrym7T83UWp47uOOOL4iMPLRSi5v0P2PxIv+cZsxuCUKOLN34pPHyaJ8giXgIE+qS qVpA== X-Gm-Message-State: AOAM533wEFpyMLaraVi/WU7NrYNSvk6dw9PR8RYb7x6y1HGOZzOIfak/ 0r9ROh4AS2hlC7FcxUyVSD0= X-Google-Smtp-Source: ABdhPJwvYO2u6/rr4XQ9KYLYNCUrcMUMbTHMRz5vC0+zhGOQLWRPjzelxGtHXRa7rUCl6xFVRO2tsw== X-Received: by 2002:a63:874a:0:b0:3ab:8715:9abd with SMTP id i71-20020a63874a000000b003ab87159abdmr18441524pge.403.1651679535572; Wed, 04 May 2022 08:52:15 -0700 (PDT) Received: from google.com ([2620:15c:211:201:8435:b3e7:62fc:4dfa]) by smtp.gmail.com with ESMTPSA id y12-20020a17090322cc00b0015e8d4eb1b9sm8632768plg.3.2022.05.04.08.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 08:52:15 -0700 (PDT) Date: Wed, 4 May 2022 08:52:13 -0700 From: Minchan Kim To: Matthew Wilcox 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: X-Stat-Signature: jtwhjjg93umhqxpegub1ik9cu9uycqb5 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D96B980095 X-Rspam-User: Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=LTFB1OjU; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf30.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.215.180 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com X-HE-Tag: 1651679523-616296 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000251, 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 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.