Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp103451iob; Tue, 17 May 2022 20:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6ECXdrcTUxe4oUKEk2p7Gg2haY/KRmFIPukC6WTa9GnUi4JiH6D0txXDmzLs6L7IWDw+f X-Received: by 2002:a63:df0f:0:b0:3db:2d4:ded9 with SMTP id u15-20020a63df0f000000b003db02d4ded9mr21922677pgg.267.1652843737340; Tue, 17 May 2022 20:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652843737; cv=none; d=google.com; s=arc-20160816; b=DTRQHJCVUCLILEWcsB/PuTCLFVZRKkMqfvr7nA2pH5lfZBa1pFIHsU8VO5YLTDYkcw auAzENTSd/nU7vENm6iv0uXERFRAZZ39DvQ9UwszOPU3bJXL+sus6FzacLgjPnYNjve0 Fbel5R3dIqDyq5lyH/HEX6xdz96nlLk924gMxPxFBIYjwS5WRqJNQpD0iSfnBufYqJFr EU9RoPOwi7WL3iN1DCmfVRhG3Y8JlihMnyXpAuMjjJ2T0yq+oa4kUDkOj3j7Ue/eiGSU Gud4RCLR8lk13B4AZvPsblfjI6bgeiPRyMFWCWzAJyaPw8nIF9DBSasF2NNwmLcylMds mwkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Z/7tKZOMTbR/3crR+xa0Rd4TytrxdsuMDGFNvqIxpvw=; b=hxUrBsJlSXGha4t1iGTjXF2HqmiaKTG1hA/30OU8Y1yBwant50z4eddO/xkjGCRziT ZzTpmXEU7SDzhgmS6YPi/zuYHWaBVkan3D80Lhr041R8D6bwemZxntxtoyBLyxhm7NPo 60DHuJcNS7Q7V/66T3kidjdYiYkqS9B373KglyTf4hXa4rs50mrGu8dP8+eEUhk3eY+u nHqprWtk/s067EsaEafRRBKwlmQ1c9ewOed2/rRoYTDDfgWq4szpBbgnN/aIOZCxmypU q6vXUrIeYcD1Cr1vwqjQuCpZumxk7gmnSgL11eARGFflD8GRpZRzuKJ/5PrCyeSjaXvc FscQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SzTmjKne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v14-20020a63b64e000000b003f5d223885bsi1014013pgt.591.2022.05.17.20.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 20:15:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=SzTmjKne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 861D55B3E6; Tue, 17 May 2022 20:14:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232186AbiEQX7E (ORCPT + 99 others); Tue, 17 May 2022 19:59:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiEQX65 (ORCPT ); Tue, 17 May 2022 19:58:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9015C3F882 for ; Tue, 17 May 2022 16:58:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 18875614C3 for ; Tue, 17 May 2022 23:58:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32E77C385B8; Tue, 17 May 2022 23:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652831935; bh=Hi3SLGJSw+umom2b/a7ZHSBRqMcZS2fHfT6dXxjlDwQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SzTmjKne7gDTvPDvUODt/tsTdkLXvjcyvkshYpnsfUmT4zexyQ5Zmpd4iTuAMH/uM sNhczWysegNmvcnGVoamaZxTyDFbd5/vv9a2VW5oOU5MSIXajUVtrqqOuGA1oL9uVV f1qd9e4JpM3sH3Yihnc44dW8PNRApap0EpjRRj9U= Date: Tue, 17 May 2022 16:58:54 -0700 From: Andrew Morton To: Minchan Kim Cc: Matthew Wilcox , LKML , linux-mm , Suren Baghdasaryan , Michal Hocko , John Dias , Tim Murray , Vladimir Davydov Subject: Re: [PATCH] mm: don't be stuck to rmap lock on reclaim path Message-Id: <20220517165854.fa6810576db304428b275385@linux-foundation.org> In-Reply-To: References: <20220503170341.1413961-1-minchan@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 4 May 2022 23:11:04 -0700 Minchan Kim wrote: > > > + > > > + static struct rmap_walk_control rwc = { > > > .rmap_one = page_idle_clear_pte_refs_one, > > > .anon_lock = folio_lock_anon_vma_read, > > > }; > > So, delta is --- a/mm/page_idle.c~mm-dont-be-stuck-to-rmap-lock-on-reclaim-path-fix +++ a/mm/page_idle.c @@ -87,6 +87,10 @@ static void page_idle_clear_pte_refs(str { struct folio *folio = page_folio(page); + /* + * Since rwc.try_lock is unused, rwc is effectively immutable, so we + * can make it static to save some cycles and stack. + */ static struct rmap_walk_control rwc = { .rmap_one = page_idle_clear_pte_refs_one, .anon_lock = folio_lock_anon_vma_read, _ and with that, I believe this change is good to be imported into mm-stable later this week.