Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1225045iob; Wed, 4 May 2022 18:00:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/QnY0WU3D3woq6WgYEZBeQcjqd+7vw1OEDRN3FxxMrNmAMg3ZQFbT/yQLj9lBCOnO0tVX X-Received: by 2002:a17:907:8a1f:b0:6f4:b5fb:e1c8 with SMTP id sc31-20020a1709078a1f00b006f4b5fbe1c8mr6774679ejc.240.1651712454034; Wed, 04 May 2022 18:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651712454; cv=none; d=google.com; s=arc-20160816; b=YJxbMVTyDN7F7gbbOS2rYMBb2Cj00z234Kqc9AWSoBLYNzHOrci8/PplJv0ZRPPCJg DgyWsTTwlcQIknrgXOl6zIxzxgHs9ViLlCZDpuhwTg8HIXjDn7S9D74DbtBG8+eqDxSS AmGX0OOgYNyLE+1ENQVn17esoemOrVIYXX9RZs6XB1jdE5MsP0cH7UuGlPhnIN1s0Pxi WYkUkhfFt7Xo3Sa3nMnNwOtVPiVHyBhve0TdPMvZWdYWjR4AztDp3uGRxj1XgITvRxJb 3stJwMFW0kRCEwnNdRMprRifDHDv7/AnUWKXJ99NaKj3zKRJVjATsQ6atwjHRYoFX8rE dvAQ== 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:sender:dkim-signature; bh=pMc4HZgJ4WDMVFUKNjkRSvRoarYOHBjdOLFJ+JcudJE=; b=RkUjb7e5OuGTeLAMbnYk2SuD6zoDTBUAyu6bBOXgLWcvSbR/vOpJrHUXeHUMQCbgWO y9ZSF9XBWhKWT94getSLogvEkmQ8++k6keJ3jBiflKNQbZUl4O3ahQ6bkFw/Mz66m/Se V44NIG/1NM+yxgDk5UBeFZ/jw/6EcOn4qD7JUz7OeNcbSabXpnGZDTnGBy46U+1fVeFj OyFWN2GmCZNjdYREoWrB1bDaAIHFlk4igGT+vQC/1x0yfUzKSCiGk/I8WFFXwPULKXSn NjuKdC51hmWZ5IftttqfiwzXBeQkWWMswgTZ7+bHGkC2LmLaDWUeVSgHFuR+e7DvQ95r 6XOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LTFB1OjU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq20-20020a1709073f1400b006f389799c4bsi667839ejc.367.2022.05.04.18.00.30; Wed, 04 May 2022 18:00:54 -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=@gmail.com header.s=20210112 header.b=LTFB1OjU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352819AbiEDPzy (ORCPT + 99 others); Wed, 4 May 2022 11:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352806AbiEDPzw (ORCPT ); Wed, 4 May 2022 11:55:52 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 313F245ADE for ; Wed, 4 May 2022 08:52:16 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 202so1473789pgc.9 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=2MVqpPIHbdY3zAprIOPnqdLyQ0Rtujo5Gdtmr5CqS+SqbbZWHDZPeProtDuxkRrX5F 11/zhYaZBaa3zeGzLGeUFpsGBmtep0moZbe3uD3r8pqfVpgfPOEIs3LmNRiArfE/ksI4 LR3AaFHFORTt+2B0EUaFDv9Wo8ZUEW3z7QoOGNDyxLHmNuA+2gXNxpuZ7UokpYHKy8LN xVEekHRqnG/nihIdPW8FoMpYBUhYmo6mlo7OLden+MgOWfzc0Is3PJysnCZfkgxSdftL EkTYjibmIZs5pGdVHf6OEfKKMx9pddFByhH1f8Cjmu0vuyKZYPzZIC1uGsUDE6NeYgyI YiSA== X-Gm-Message-State: AOAM533jyg26nclOlAi6zOOu7pEPQ1hLoLp/eA/Ihkv+3uX/vHio5iCP jTJwKmSA+ERxqKF5ChlL/uQ= 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) Sender: Minchan Kim 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-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 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.