Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1359859rwl; Thu, 5 Jan 2023 12:23:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXuwT9pmliE+h1RydqjNSg4sxqqzECUCJNE/gcSSOtCCvLAqfEbEByFwEmcO0lE2ErCMNiHf X-Received: by 2002:a05:6a20:4d8a:b0:ad:d182:cd50 with SMTP id gj10-20020a056a204d8a00b000add182cd50mr57114280pzb.36.1672950231935; Thu, 05 Jan 2023 12:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672950231; cv=none; d=google.com; s=arc-20160816; b=lUoBnEzMIgZR7GNAXUMtcTCJa8YOLOPjy0q4TJguQUWZYdsx4fcTKDtt9b6Tm4KRzx JFb5ir33+PMyPLNcDxiOQHec9WCOxl+yS+0qTEDRVc/OzbWjgVxuzQYAiZ1Co7Var4Yq ACG/gClcAj9dhRQT5GUsXv3lsjnBgkGKYcHlM78PnjGbcUBAb53kTTtYaN95ydRjMIP9 3lJHkRbsnZaXiJSGSl3+8CkumEEJ10UfqrelE8BrLCoCL/9PfqZMDNfBn6dTgG+oMkKP zZtJ1jiqBFfyfPcQ+yzkvixTYJoRKRwkSO4c+B+zr2e8abzZkVenkHgz1i2JdHC74AMd JxuA== 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=Ro6ZV0KueD+WBFZnlJYwaGtOgX1sJsVct3jvuPBlVJ0=; b=l2IqnO3daFngT8hgR48/EhZdeCcujPxP/Dn/KvPiU4M0xaP+8mJCoWZ8K8ct+fSNrs tv/gMOnMobTtdFb8kJNaRpC3PA/tJux9aEArEkKaZsncU6VMwNyr8ASDS/JzeGwYy4Ny qv8lQv+ud0x6BVnNmAFNTTZvaDkHjxKMqMdkRMXZB5wPyB4FUhKdKjIMAlunLqW68y9R 9T1wmT3XvYlo4vJ4bdsIoUkAY6/r7EiXtUnTV/Lej/plpVqSYlXs9xJ0Zk6HcSdrrFiW xLMzDgLu9ZEifXWYHV5aetLtaYg2vHK7VTlhgIUrugmFcwu2W92qxKoO8c3qQpr8WCRs IlWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UZ41CXtx; 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 h2-20020a636c02000000b0047867fcf9a7si37085999pgc.541.2023.01.05.12.23.44; Thu, 05 Jan 2023 12:23:51 -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=UZ41CXtx; 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 S234584AbjAEURD (ORCPT + 57 others); Thu, 5 Jan 2023 15:17:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235108AbjAEURC (ORCPT ); Thu, 5 Jan 2023 15:17:02 -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 1584DDFB2 for ; Thu, 5 Jan 2023 12:17:01 -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 C51ABB81BC0 for ; Thu, 5 Jan 2023 20:16:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C55F4C433F0; Thu, 5 Jan 2023 20:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672949818; bh=r3UUh01lMIQpHkRFoc0xsCt5i0tnsap0EO6qM6kQfmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZ41CXtxvnwcp4WgInyMxrMcSIoEwQbVWAd8MAelnrZzGFRcvmgFQX/ZtqSRZ9NQf Y339Drwthb7PxFoFu6G7iK89Oj3nCKBywcyC4wUWvr58X1iZd/g3Y09r8d3U7jx07l CQPTKHTVIYZ8Bot2f+1Ucwhs5OnOBBzcm3vcmpaMLI8K4n/iXSwKk6691Mv1JYiIed y8OQqRGxc6Hy96BlbAGWtsz3P0O6WwDgJn+jP7iZYN+QlbSaNAeol1wuaDKTxwx2Zc Rb7l87axgTRk5TTyLktKRipIn+vvguBBQC4VqXw6SW6awlDVYVhmAJi4sN/FvEwbHr Bpz98GnoTxjTw== From: SeongJae Park To: Liam Howlett Cc: SeongJae Park , "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton , "damon@lists.linux.dev" , kernel test robot Subject: Re: [PATCH v2 26/44] mm/damon: Stop using vma_mas_store() for maple tree store Date: Thu, 5 Jan 2023 20:16:56 +0000 Message-Id: <20230105201656.49522-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230105195213.acthhrocx5vz33uy@revolver> 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 Hi Liam, On Thu, 5 Jan 2023 19:52:21 +0000 Liam Howlett wrote: > * SeongJae Park [230105 14:33]: > > Hi Liam, > > > > On Thu, 5 Jan 2023 19:16:00 +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. > > > > But seems this series is not really removing 'vma_mas_store()'. Wouldn't it > > better to do the preparation and removal together in a same patch series? > > It does from the all code but the nommu side. The definition is dropped > from the header and c file in "mmap: Convert __vma_adjust() to use vma > iterator" [1]. Thank you for nice explanation. > > > > > > 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 | 6 ++++-- > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/mm/damon/vaddr-test.h b/mm/damon/vaddr-test.h > > > index bce37c487540..41532f7355d0 100644 > > > --- a/mm/damon/vaddr-test.h > > > +++ b/mm/damon/vaddr-test.h > > > @@ -24,8 +24,10 @@ static void __link_vmas(struct maple_tree *mt, struct vm_area_struct *vmas, > > > return; > > > > > > 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); > > > + mas_store_gfp(&mas, &vmas[i], GFP_KERNEL); > > > + } > > > > On the latest mm-unstable, vma_mas_store() uses mas_store_prealloc() instead of > > mas_store_gfp(). Seems the difference would make no problem to this test code > > in most cases, but could I ask the reason for this change? > > mas_store_prealloc() expects the maple state to have the necessary > memory to store the value. Using this function is the right way of > storing the range. In fact, we would only need a single node since > these values will be append operations anyways. Again, thank you for nice explanation. > > > > > Also, should we check the return value of mas_store_gfp()? > > I can add this. The only reason we would return an error is on ENOMEM > which seems unlikely here. Again, it is a single node that will be > used. The size is 256B, but it's safer to add the check. You're right. I'd prefer having the check, but I'd not block this for the trivial nit. Reviewed-by: SeongJae Park Thanks, SJ > > [1] https://lore.kernel.org/linux-mm/20230105191517.3099082-28-Liam.Howlett@oracle.com/ > > > Thanks, > Liam >