From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EECDEC43334 for ; Thu, 9 Jun 2022 13:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343822AbiFINan (ORCPT ); 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 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