Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp955534rwb; Fri, 13 Jan 2023 06:16:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXv09BABwTMcFiDc/S3hpB5BFFEZNRzAbrqe/ncbkJ0vZBsylyRZDfMzICbgcbJ0e/+M5Eaf X-Received: by 2002:a17:906:f0c1:b0:7b9:f9d8:9554 with SMTP id dk1-20020a170906f0c100b007b9f9d89554mr3240575ejb.40.1673619399060; Fri, 13 Jan 2023 06:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673619399; cv=none; d=google.com; s=arc-20160816; b=UwktqsvN49ZB6k1hmYPZoIDaSWcTWYpkGbSX7273tjrsItqpDoGl0eXgiHIde4FUF4 3vrJrONtozPTN1Nt3AVeYyWtsTtGnQl2Fqk2FlKHUfqXgVU0aGq9RJCOwNPOaze0vZCg 4VTmW6YsW30MdwxparfiizIMoDoT1Rl79kvfYwNOeb7NYoDwYSPfaJL1sHhtVTER1yTt t6jVn0SGweT9zYeE+N9RGs3OLuiYTynl1ReyX/vu4qklNyteba8YUj/q8heIxdAesbRk UrHRpY8dBqd1BFEg6o8I9reG0RAtcpaO0GpTPS53DAR6q48apZZzqxihSqSSDjw+7mbL xjQQ== 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=6kboQ5MB7uZ6CHhRg2eIn8RfDMDJ2TsZf8BKVulus5A=; b=NVfSIHEgiOumL+ElZSr7JiZno8HqsES0oK0V2ENf/aY7SZaC9cyVz6Z9pfPEaIvgRV /Q+BaQ922GmQioV0MnfJyy+sQtHd2xVYCu5APl2emQ/wdqSeIK67P+NWecnTxWtiUMMH /8X1avxgJJvWbWJjmn1ZU9g57GQTyZztxi8EUDiU7+znZKPkpXIaOVu4Fit42Kl0PntS dLAsjauyu7SEsm3CtnHGGqap5hTY9MvJKToeBCca+GXvpeVnerU386Ns4YPcvB5ZfmF7 zbXKjdcVW6kNFkXM9QUpjKV+NFkNZJq7LrCFWro5Pdj1ZTm5D3cmRhROA/Sp5vPIl3RO Qd+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZTAU6Pkn; 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 r19-20020a056402035300b00483c6dd461esi19080700edw.203.2023.01.13.06.16.26; Fri, 13 Jan 2023 06:16:39 -0800 (PST) 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=ZTAU6Pkn; 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 S241852AbjAMODG (ORCPT + 51 others); Fri, 13 Jan 2023 09:03:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241808AbjAMOCA (ORCPT ); Fri, 13 Jan 2023 09:02:00 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 414BD1CA; Fri, 13 Jan 2023 05:59:34 -0800 (PST) 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=6kboQ5MB7uZ6CHhRg2eIn8RfDMDJ2TsZf8BKVulus5A=; b=ZTAU6Pkntpy8KSSflFMFJA3/gN HcJPCQ631UoV2WzEQqkqBBRdS27YRmIkPpCdYTrvOnvUolnOaXifUsp+2b65sxHOta8lGzjoSrgwc VoSKLSh3nfRimYnSzPZMhWamT1YRmRsOHkw0bZUjWOfDVFlNWWwxGnl+cZN82szTQepK5g1XbHefy mG9Ety+ssNpJsCiAOr9DXLXTwbjjzOKeKgWyPWaeanvE0O03P9LaO2HE/NsKmu40ggOiM3aFQzL9y Xpvc8GJqBrxfKlsYsKrpyUZemhy2q4fde6o8PQt6HQbEIjg3vIwA6dcFY8bGeaBQk5vjXxAb/J8tk QX7/er3w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGKaj-0069DE-CO; Fri, 13 Jan 2023 13:59:33 +0000 Date: Fri, 13 Jan 2023 13:59:33 +0000 From: Matthew Wilcox To: Bagas Sanjaya Cc: yang.yang29@zte.com.cn, akpm@linux-foundation.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, iamjoonsoo.kim@lge.com, ran.xiaokai@zte.com.cn Subject: Re: [PATCH linux-next v2] swap_state: update shadow_nodes for anonymous page Message-ID: References: <202301131550455361823@zte.com.cn> 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 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 Fri, Jan 13, 2023 at 03:47:31PM +0700, Bagas Sanjaya wrote: > On Fri, Jan 13, 2023 at 03:50:45PM +0800, yang.yang29@zte.com.cn wrote: > > This patch updates shadow_nodes of anonymous page when swap > > cache is add or delete. > > By what? This is not a helpful question. > > @@ -252,6 +256,8 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin, > > struct address_space *address_space = swap_address_space(entry); > > XA_STATE(xas, &address_space->i_pages, curr); > > > > + xas_set_update(&xas, workingset_update_node); > > + > > xa_lock_irq(&address_space->i_pages); > > xas_for_each(&xas, old, end) { > > if (!xa_is_value(old)) > > Adding xas_set_update() call? It makes perfect sense to me. > In any case, please explain what you are doing above in imperative mood > (no "This patch does foo" but "Do foo" instead). Not helpful either.