Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp443061iol; Thu, 9 Jun 2022 07:00:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBsf2MPnyVvhbrxKAs49Cgnv6/NyY+OGHdLSiEZskXBweFxShKnz7DOmUOIGAqmRwkvZCr X-Received: by 2002:aa7:cb13:0:b0:433:4985:1b54 with SMTP id s19-20020aa7cb13000000b0043349851b54mr661776edt.182.1654783233273; Thu, 09 Jun 2022 07:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654783233; cv=none; d=google.com; s=arc-20160816; b=lwBaKuRyX5ob/j2hIxsUx5RoOa4zrN+//T0dSWlBk5OwEAXQt6oKvXYbR8BFzir1CJ WdG8sQTzaT7uuOS3wSdLtUNWYGCxORxJsBJb+0p7YMXowoThrfc6GyV7W4hFNugXKOMN JOkNvHXe6HGMVHcYlb9v66HU6juTOrEEbqz76eNBlY+6kBjTB8eHVWx6ZkbCx/9OESej Fxg5qK2qQPunPBKjTYs/B4z1ebizUf6DbFy7jSSYcNSwjnfedAZbbBx+wGSKH1uAVN6J Uo6HpRuMSOkbVeEGXwYCuBj9il/sBCpn4JhqcR3k5VrLJqHTpXf1552/CkyfwXFbN/rj YnAw== 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=1mC1QYmn978WfCQsrC8f3Fo2KEFYsaqiMkr4bIkQmJE=; b=MZOavMsXyPU0OOqpW3Y0sjRNqQ8EzY4gxeMD9zKnPgbjB9NsmoDlamtjNwVXvXVRih 1n9UWb39XxLmkDF/cqvnGhujKT/KsbCCCG+ESwP4kCTzRPmscQgBKVyUKGRspVCQzuW7 tHFDtUr15tOUHZbyNfmU0H7KgvKzLGgP7ztqLXNPmkwuLMTdzouBMo5pBPzPdHL3CImU gTmppxAMpcoEPaCD2cdwe+KSrH+bi0j4C/+7z+Xg5loDF7ZmYOYYI7+YiR2mnwiNdJ/K 8m7t9y6o8gcI3EHHjQAwIl4vERboI6NIMoKnI7rK56wdHGUmCNhKUl5OoZFlXE5vZa1g nitQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EOdmVzDz; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a50c94d000000b0042dd0f67c24si23145091edh.142.2022.06.09.07.00.06; Thu, 09 Jun 2022 07:00:33 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=EOdmVzDz; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343818AbiFINan (ORCPT + 99 others); Thu, 9 Jun 2022 09:30:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343637AbiFINal (ORCPT ); Thu, 9 Jun 2022 09:30:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1A754E7321 for ; Thu, 9 Jun 2022 06:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654781440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1mC1QYmn978WfCQsrC8f3Fo2KEFYsaqiMkr4bIkQmJE=; b=EOdmVzDzz1s6ayDQhdTsbgOhbOrt8mdUywlfWCkEjigFT/v8KcS7Hl0t8tCO99lWZWtvIn +n//P0yTP+N4kx1vjVNLwdYambH+ND7Kg+sqLg4cVn9KqyLp0yg5A13wmZq/q/dtcaAOpz /1IMfx+DCJaXZ84w/DFaBE37c7+enMM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-216-5ZC9NpOeMouIDj5Dlqd0Gg-1; Thu, 09 Jun 2022 09:30:37 -0400 X-MC-Unique: 5ZC9NpOeMouIDj5Dlqd0Gg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51D62800882; Thu, 9 Jun 2022 13:30:36 +0000 (UTC) Received: from localhost (ovpn-13-143.pek2.redhat.com [10.72.13.143]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 775B81121314; Thu, 9 Jun 2022 13:30:34 +0000 (UTC) Date: Thu, 9 Jun 2022 21:30:30 +0800 From: Baoquan He To: Uladzislau Rezki Cc: Andrew Morton , Linux Memory Management List , LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Oleksiy Avramchenko Subject: Re: [PATCH 3/5] mm/vmalloc: Initialize VA's list node after unlink Message-ID: References: <20220607093449.3100-1-urezki@gmail.com> <20220607093449.3100-4-urezki@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 06/09/22 at 02:36pm, Uladzislau Rezki wrote: > > > > On 06/07/22 at 11:34am, Uladzislau Rezki (Sony) wrote: > > > A vmap_area can travel between different places. For example > > > attached/detached to/from different rb-trees. In order to > > > prevent fancy bugs, initialize a VA's list node after it is > > > removed from the list, so it pairs with VA's rb_node which > > > is also initialized. > > > > > > There is no functional change as a result of this patch. > > > > > > Signed-off-by: Uladzislau Rezki (Sony) > > > --- > > > mm/vmalloc.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > > > index 745e89eb6ca1..82771e555273 100644 > > > --- a/mm/vmalloc.c > > > +++ b/mm/vmalloc.c > > > @@ -978,7 +978,7 @@ __unlink_va(struct vmap_area *va, struct rb_root *root, bool augment) > > > else > > > rb_erase(&va->rb_node, root); > > > > > > - list_del(&va->list); > > > + list_del_init(&va->list); > > > > Don't object this change, while list_del poison members, which is also > > not bad? > > > It is not bad for sure. The main aim was to be align with what the > RB_CLEAR_NODE() does, i.e. initialize VA when it is detached > and be safe with list manipulation when it is detached. For example > whether it is empty or not: list_empty(), etc. Agree. list_del() can't make list_empty() work, and RB_CLEAR_NODE() has done the clearing already. Then this change looks reasonable to me, thanks. Reviewed-by: Baoquan He