Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5389231rwb; Tue, 17 Jan 2023 13:06:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXt315ldsF/Il75EffM7XVwxUERBFYswIYm+HgniS+Ob0HyzOoZabTiDWRXsWkpwOzXTx5Oj X-Received: by 2002:a17:90a:3ee1:b0:225:c712:5df8 with SMTP id k88-20020a17090a3ee100b00225c7125df8mr4072743pjc.3.1673989561498; Tue, 17 Jan 2023 13:06:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673989561; cv=none; d=google.com; s=arc-20160816; b=dW0p+bXLsWGIa2xP4KHjW2Pr5tk62HZStxbOI/YSckCNw10r4+Q9nQnWkBg4GbLPo2 ay98/VBUOdRDRfmk9cQk4Ckw9onPFHIFI99yL39wauAsW5UYgGtTPc8xiNVXkhOVkXLQ 3YB9ayg0dOXOdrXn5llG9cP60uQxMWAl+a/FXx2n2iPMB5CHIp6AEFHKjkpvbqwO5NF4 jEPizkrINZ6YZckpzy13LB1hf36f93F0LXh1SGICkUhur8mj4Rfkk0DHhW66XHRDi8nz As5jdh1aegCPNitd7mJtJ4j/69efXQoff3qGEeDwQ5HC6IumikujpcF4agRMwxq2h55q klfw== 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=Gkr9G7bxpoF9SeYxWK0ky3ycJSU7j9uwmK5oXFyGYYg=; b=ncE3wgvdq7rxxqkbyP9YqeUaNfucItHZs82VHMnTjgdAB3LU22dMXC/Ap+RDXqeoNq znstLGqsKVJPlpGFtNha/iMUqVpnT6ywAGIKDWBhNxL1XppfYzyunPxT5FHuixH9KQ+k 78UIrfMZ+cXPuAy3arPH9uWVyzTSLn7y1xD9nQdBdZy8BXxw68TbHjn9ecRbqlMD907r u0wS9YUj+1S9oTSRbaBCAkV8jN1JeQhN9oqNyK4u+nSaq1XQ1VDw5lmQdBhGswSQLnHU Mo6Ao1bFmCZQtZvh/e2dwqcynWKgioW9KgfaM/Gbr8ZON3CWYQjjl36khzXikwOQrqqb ddGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmT6EUBn; 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 mw14-20020a17090b4d0e00b00218de7c19efsi40579228pjb.108.2023.01.17.13.05.55; Tue, 17 Jan 2023 13:06:01 -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=SmT6EUBn; 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 S235437AbjAQUiQ (ORCPT + 49 others); Tue, 17 Jan 2023 15:38:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233949AbjAQUaH (ORCPT ); Tue, 17 Jan 2023 15:30:07 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00EF93D927 for ; Tue, 17 Jan 2023 11:16:19 -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 ams.source.kernel.org (Postfix) with ESMTPS id BA199B81A0F for ; Tue, 17 Jan 2023 19:16:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AEF1C433EF; Tue, 17 Jan 2023 19:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673982976; bh=aYhIaG8n5o0p/BBkpaMa18FYk6ylAOgNMDr8sc9WmPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SmT6EUBnqXvnF9/qA9QUrYikLol+V9f38rBhMO8+d3JYmfHgQb/QBhfFgWk30gB5T mIMBlMv9Tk2mGEKXbwFk2Y/tFaSk+CENtRIHyhNrL1AtuaCPkagw6tHWx7jCF39bJv 4u2rLBOi73ycfS3m1SZoe0YGQB67+IwT3CgUEQ8wM6MF25C3CigZYFpwKFAqfkd4Rf P+MCQgZUZmmpdo/sonOi+js5YEKH03CgxpValLwJY4s+A6iS8uXkpCo3rHjfJDHD23 2VHgugQ5T9bXuDs0ILM+XcFE9jgn0pVcQZXRa0Y4dW+ANgbx/ubxxcvw9Qtb2beM8B 0DvGIUS88Miqg== From: SeongJae Park To: SeongJae Park Cc: Liam Howlett , brendanhiggins@google.com, kunit-dev@googlegroups.com, "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "maple-tree@lists.infradead.org" , "damon@lists.linux.dev" , kernel test robot Subject: Re: [PATCH v3 30/48] mm/damon: Stop using vma_mas_store() for maple tree store Date: Tue, 17 Jan 2023 19:16:14 +0000 Message-Id: <20230117191614.116521-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230117191109.116438-1-sj@kernel.org> 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 On Tue, 17 Jan 2023 19:11:09 +0000 SeongJae Park wrote: > Cc-ing kunit people. > > Hi Liam, > > > Could we put touching file name on the summary? > E.g., mm/damon/vaddr-test: Stop using ... > > On Tue, 17 Jan 2023 02:34:19 +0000 Liam Howlett wrote: > > > From: "Liam R. Howlett" > > > > 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 > > --- > > mm/damon/vaddr-test.h | 19 +++++++++++++------ > > 1 file changed, 13 insertions(+), 6 deletions(-) > > > > diff --git a/mm/damon/vaddr-test.h b/mm/damon/vaddr-test.h > > index bce37c487540..6098933d3272 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 -ENOENT; Also I think it's ok to return zero here, as this function successfully linked zero vmas as requested. Thanks, SJ > > > > 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,7 @@ 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)); > > + KUNIT_EXPECT_EQ(test, __link_vmas(&mm.mm_mt, vmas, ARRAY_SIZE(vmas)), 0); > > In case of the __link_vmas() failure, I think we should skip this test using > 'kunit_skip()', rather marking this test failed. > > > Thanks, > SJ > > > > > __damon_va_three_regions(&mm, regions); > > > > -- > > 2.35.1 >