Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2231158iof; Tue, 7 Jun 2022 23:57:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5q+BgjjLja9mYsWBpKVQ8a2sWbKrzmm+Xfeg/xEr+eWfwWqJ8XRoXuhZv/sAG8O9OMD0t X-Received: by 2002:a17:907:3e15:b0:6fe:f10e:6337 with SMTP id hp21-20020a1709073e1500b006fef10e6337mr30497897ejc.209.1654671432990; Tue, 07 Jun 2022 23:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654671432; cv=none; d=google.com; s=arc-20160816; b=GzhyKZd8732SjrlGFW0m2WnqyyKVg6ymnfhsLRgwvcLjuHVk42ek0wXdoarxJa3c66 Kkjq/qshEWXfUyFLpH1URRI0G1L8iYtLlwDmOpONT8k2RFOwQn9XCyJb25C0RXetSG5+ I7Usq+9Z89JQdL+eiQjV9cDGjYbGOhR371vz4EGGGcc68TpXYQeGC5fTdFra9nCPZebT diXdvdXACp7gvQqp0B5PTGW3FI0x4Nh2lLRouysWV3AEIh4Mpg3SNDiFqJf8+HOl4rrJ Pny59tB1vkt0Nvz1Ld5Wmt3LnZmMTU3yGzZ6Dle2VQh9u6hq9E4x5UdDmGMxxeruj8RI PM+Q== 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=tEPTWYbvI5NJZCPcqRYQAZ13jlNYaW+Mr8ondcYJw3w=; b=m3ocjQILgjwbd5ZzcolixMx5jCbYCyRVXEPv7plS4K/zthx6uKY+NYo2BF4PWWXEpp WxmfseFqsWkxHY6/AOYQKScVQpJUoFGuMAL9QXDrsz1Uo5lrVKEhOa3OnA8w44mppc0j pdR0NAvo5YzWFc1OsypS2ZENlKuhKBjDY/uoBA6VW6IcBf4vJ8OajheecNSTMOq5xBSx 4BLdGd5OQZy1r9rrxgBhIgQWrwXy5fFiCZBprq2byjhlBDqw8b70S98nsiotb77gSwO5 0FsS8hjbUVSPqdIBoleGqAne/J92DRJDbZ6ZrsTR4vzXN6v757/1dWu+U4zWtJ9Mra47 TyHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L7+nM3Fg; 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 s11-20020a056402164b00b0042ae36e2432si20955734edx.132.2022.06.07.23.56.47; Tue, 07 Jun 2022 23:57:12 -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=L7+nM3Fg; 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 S229510AbiFHFsQ (ORCPT + 99 others); Wed, 8 Jun 2022 01:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235069AbiFHFqW (ORCPT ); Wed, 8 Jun 2022 01:46:22 -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 1EA0B3C0E8F for ; Tue, 7 Jun 2022 20:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654658389; 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=tEPTWYbvI5NJZCPcqRYQAZ13jlNYaW+Mr8ondcYJw3w=; b=L7+nM3FgNjXRA2hZy5QSFDARVlzE3CnK6YO3qGG4zAm6gNnnypKpw93KQrz+vKEKoL3+IC BncGJWmnxjWIeL+rkJ6KRlTHN79uQ6wSwv6LgqYTyFZAUMflJJybGmW4pF3aqatKy052hm agcR4frqWgHReowJ/MxsVD3lFXg8qv4= 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-294-4qN6XzvqNPqlEDBUIhTvug-1; Tue, 07 Jun 2022 23:19:45 -0400 X-MC-Unique: 4qN6XzvqNPqlEDBUIhTvug-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96C9485A581; Wed, 8 Jun 2022 03:19:44 +0000 (UTC) Received: from localhost (ovpn-12-81.pek2.redhat.com [10.72.12.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFD30492CA4; Wed, 8 Jun 2022 03:19:43 +0000 (UTC) Date: Wed, 8 Jun 2022 11:19:39 +0800 From: Baoquan He To: "Uladzislau Rezki (Sony)" Cc: Andrew Morton , linux-mm@kvack.org, 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: <20220607093449.3100-4-urezki@gmail.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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/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? static inline void list_del(struct list_head *entry) { __list_del_entry(entry); entry->next = LIST_POISON1; entry->prev = LIST_POISON2; } > RB_CLEAR_NODE(&va->rb_node); > } > > -- > 2.30.2 > >