Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1095920iob; Wed, 4 May 2022 14:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2qsY8G+DsMKp6BOHy+ADqbeMmh+2KRamDwhagr5eLUC7oIbUx6sk9xK5T6mRU8OsWu5+1 X-Received: by 2002:a17:90a:bc8b:b0:1d8:6884:9d9 with SMTP id x11-20020a17090abc8b00b001d8688409d9mr1875315pjr.142.1651700259021; Wed, 04 May 2022 14:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651700259; cv=none; d=google.com; s=arc-20160816; b=L6ykh95T9oVctNyhY2XObxE0/AWdnIHokdMSfwF4R7hVs7CyQDaPlzfpP6L+k9otP1 WhkqvH0dwFrZ5+j5iKTGqwH2FPUOF9TJgFcjS40ZCjB215ZAcvrjnv3GU29k3F+yj0JL HA/OyT0AH8fBKXOgDFnYLFQTaoopJbWvhpk62EOU6/ud2GLbtOsPiaEnXtNL3qLrcXHd obyA/fjUX5WMpVibPyEeC/kOGzruO7uoY7DWkpD+J91Wa8px1mY2UguDSzCRehqhgEuu WDU4ACRl1ZsqU9hkAGlIVWRtvNx8AgyhwvB/SP5ow2NBVG7tMRaJdphq70XXY786WJcF WvnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vxwk6Ijca/aYX+YfbJBlvvvvNjiuUacuBmt+5rQYXNM=; b=VPiLexGkdhCZUKtAx6wLUFsK3T3hqBX5yHxZAznyz6fKXXIOsQ7seGNiwDskIYy78F FfQXNNIGyUUHBGGYs+FzztSj7gpilqF1jotx+C8jph2WP+RlbRb+sMifn4BoA7sJbpzQ s6rW92mbM240XC5mr9r9ZZm32yk7taODNs5SaDVJlcjRq+cTDtrbIo1N8zl8270kCGZL Nj4hjXzy9wGBtepfQ1oDn7GvF8Xj9l3wVmaFeVoM0Y/mGZsYcS6IUZu1qihRREhZNYHR DPIGFmE5AAlECpC8zaSiZjGiqLZzwcBH2p53WtcMQO3/nvg8A/bsa7L6RjoXjCKNYSWY 2h2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="oDQFuDC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 p185-20020a62d0c2000000b004faa8dcd125si19848261pfg.72.2022.05.04.14.37.23; Wed, 04 May 2022 14:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=casper.20170209 header.b="oDQFuDC/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359646AbiEDRkM (ORCPT + 99 others); Wed, 4 May 2022 13:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356793AbiEDRJo (ORCPT ); Wed, 4 May 2022 13:09:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205BA1D33C for ; Wed, 4 May 2022 09:55:36 -0700 (PDT) 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-kernel@vger.kernel.org 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().