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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D86B3C433EF for ; Thu, 9 Jun 2022 13:30:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 214618D001D; Thu, 9 Jun 2022 09:30:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C3798D0006; Thu, 9 Jun 2022 09:30:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08BAA8D001D; Thu, 9 Jun 2022 09:30:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id ED3E08D0006 for ; Thu, 9 Jun 2022 09:30:41 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id AC81E813B6 for ; Thu, 9 Jun 2022 13:30:41 +0000 (UTC) X-FDA: 79558782282.20.0535FEA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id C0F5C40074 for ; Thu, 9 Jun 2022 13:30:40 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654781441; a=rsa-sha256; cv=none; b=TDJRXZ0GN+6j+Rir7JJidqx4o3mWXmjfBqdWBbuWOGdOpYfQc7g/BpcS3VPsU0xgzVXlyE qDJnH8e0cIzHE+G2xh/eH0Ou55MWXy9ZnNSIalh3NbKrDPTFIPFkLu6Z/1l6GZNcUTfVAx xqnaxXktI9PJIV6nSmE1pxkTc86M5EE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EOdmVzDz; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf17.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654781441; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1mC1QYmn978WfCQsrC8f3Fo2KEFYsaqiMkr4bIkQmJE=; b=jumUEX1w5QfqfMYwl80bhq3SYxbQJuev+pTmZpVXJGcf+lH4N3Yxtqys+kOGMoQ4cH/9Hc ENCZIEcTy0cIq55368wn6nBOZmJ6207pojTefQo2SESvv4VIltOqih8w7Ij7Ioz6YbGqSv Kya4eleKKMUz7Z6DrFgSPG7EjM1B/HQ= X-Stat-Signature: 8a8jw3g8ont9n6w9ryixyimtpeznobem X-Rspam-User: X-Rspamd-Queue-Id: C0F5C40074 X-Rspamd-Server: rspam07 Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=EOdmVzDz; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf17.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=bhe@redhat.com X-HE-Tag: 1654781440-199255 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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