Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3018974rwb; Fri, 20 Jan 2023 10:06:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXu1fqq6rd9IoIhVlr04yAYsQcuTwmOxd1VhuXo+VbqDvoFGOMYgFKGUvvNPJnp14ujmvWbJ X-Received: by 2002:a05:6a20:a698:b0:b6:95d0:548a with SMTP id ba24-20020a056a20a69800b000b695d0548amr18022580pzb.1.1674237988205; Fri, 20 Jan 2023 10:06:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674237988; cv=none; d=google.com; s=arc-20160816; b=Wj+HUhBJpeYHIUsLb8fCHr4HaNSdNzsOLES5V3rNbJb0nD89YlU4mS53FzpecEIgAr 8jvJeZIhlmw6OaXHf6c/SSamiir1b1vZ5RJM2upE3AEpVdusL0krMr8ojwrQzfmLIxbA RrKH9JAn3g4c9spA1oitL4U6J0f+xat3By2dIL1TQRd6kQGMDl5EkPw1zWOHkMiBVw75 FP7cfPYSq6EdceiSI0vZ5Qv4Zo1i4yizhibUffxJif2kT7p9LUdn6KrJ+QEKUkIcycX7 sEMPygZsyoQEdds+af1SiaepjMTcoOT+L9HFnU9W874YMA0x6SLOCm3j26gT44DnS7kB kNGg== 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:date:subject:cc:to:from :dkim-signature; bh=HaUcZ55B8arNmp1X8CFvPgSjjgacvYdFWg48TpRfPos=; b=DN2HWcB/j/5kR/pyieSVQTsBR7Kybf0ebPW3nwcLbgYfgbJQX5rYvkYuSuib5mTpln b4gVBnowEeUTCkmzJAn/YUCdaX3PTsc09KW5rlGhYvELnSN8eXSd9S/jcFPFjefE4xAa dk0HIGRxfaAbIWP7iRs3YxFjOC1c4xfQLZvOrWNqppuivz90dGmjcCWhEVX+9HtvN8T0 EM/uMmorrUmZHzSZctRW8vZN+8BUb3L/YmsPG+hAGObDE8wW734yG7NgB1Erl5UAXBeQ GshQXHg40ziMAOoQ1H1CO0INgUNYHUkxRkQ7CY+VJfB3dVEmC7onfUhaNXxJTia74F3m Tu9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kzGNUytQ; 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 i13-20020a63e90d000000b00480a937f894si43422719pgh.766.2023.01.20.10.06.22; Fri, 20 Jan 2023 10:06:28 -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=@kernel.org header.s=k20201202 header.b=kzGNUytQ; 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 S230224AbjATRcm (ORCPT + 50 others); Fri, 20 Jan 2023 12:32:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbjATRcj (ORCPT ); Fri, 20 Jan 2023 12:32:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36EE9C4E9E for ; Fri, 20 Jan 2023 09:32:14 -0800 (PST) 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 B59036202A for ; Fri, 20 Jan 2023 17:32:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80CBEC433EF; Fri, 20 Jan 2023 17:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674235926; bh=66lCwGr0kp2dV1EmIDVsi3nb8gKPsiT1pssRkZM63gw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzGNUytQ/EN25BaE3o4Jm9mc/FX9YNMeRuRbcyWs1Jw5BvNv2RtE+xsUd5EhH4Diu GIVavSCtdeqkvMya55jk7xkTGvZrfwSJQ8Jbz20rEq3IOhz185yqUSv8+LCzVo7rzZ Efoxx1SXEcEgqqqubUmXGTtBWVvnevdTvlH89qxTUhK32Tii1oNvZx1Nk9J/mksB4p Y9mB6jY1UcioeghSLXHW6iHTCv5VxkSYpQFQTxSAZQTudCkdu9h4kOwEL+9oFwWqgP zvxzakFDHuQgK0BNgqQtjaOCWD3C6T18Is34IdLOCRsn+r5mt1HvSyDvVwZ92A+16B k59IQez5f3GcA== From: SeongJae Park To: "Liam R. Howlett" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , maple-tree@lists.infradead.org, SeongJae Park , damon@lists.linux.dev, kernel test robot Subject: Re: [PATCH v4 30/49] mm/damon/vaddr-test.h: Stop using vma_mas_store() for maple tree store Date: Fri, 20 Jan 2023 17:32:03 +0000 Message-Id: <20230120173203.150532-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230120162650.984577-31-Liam.Howlett@oracle.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Hello Liam, On Fri, 20 Jan 2023 11:26:31 -0500 "Liam R. Howlett" wrote: > Prepare for the removal of the vma_mas_store() function by open coding > the maple tree store in this test code. Set the range of the maple > state and call the store function directly. > > Cc: SeongJae Park > Cc: damon@lists.linux.dev > Reported-by: kernel test robot > Signed-off-by: Liam R. Howlett Reviewed-by: SeongJae Park Thanks, SJ > --- > mm/damon/vaddr-test.h | 20 ++++++++++++++------ > 1 file changed, 14 insertions(+), 6 deletions(-) > > diff --git a/mm/damon/vaddr-test.h b/mm/damon/vaddr-test.h > index bce37c487540..c4b455b5ee30 100644 > --- a/mm/damon/vaddr-test.h > +++ b/mm/damon/vaddr-test.h > @@ -14,19 +14,26 @@ > > #include > > -static void __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas, > +static int __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas, > ssize_t nr_vmas) > { > - int i; > + int i, ret = -ENOMEM; > MA_STATE(mas, mt, 0, 0); > > if (!nr_vmas) > - return; > + return 0; > > mas_lock(&mas); > - for (i = 0; i < nr_vmas; i++) > - vma_mas_store(&vmas[i], &mas); > + for (i = 0; i < nr_vmas; i++) { > + mas_set_range(&mas, vmas[i].vm_start, vmas[i].vm_end - 1); > + if (mas_store_gfp(&mas, &vmas[i], GFP_KERNEL)) > + goto failed; > + } > + > + ret = 0; > +failed: > mas_unlock(&mas); > + return ret; > } > > /* > @@ -71,7 +78,8 @@ static void damon_test_three_regions_in_vmas(struct kunit *test) > }; > > mt_init_flags(&mm.mm_mt, MM_MT_FLAGS); > - __link_vmas(&mm.mm_mt, vmas, ARRAY_SIZE(vmas)); > + if (__link_vmas(&mm.mm_mt, vmas, ARRAY_SIZE(vmas))) > + kunit_skip(test, "Failed to create VMA tree"); > > __damon_va_three_regions(&mm, regions); > > -- > 2.35.1 > >