Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp378277iol; Thu, 9 Jun 2022 05:48:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlFSIAE/rBJNEF9vWJ72ibiVMxzPFuaRLbk70luffIQkh/FTf+53jcz/8CoFvl5ydActzQ X-Received: by 2002:a17:902:f60e:b0:158:5c4d:d9b0 with SMTP id n14-20020a170902f60e00b001585c4dd9b0mr40089732plg.63.1654778935711; Thu, 09 Jun 2022 05:48:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654778935; cv=none; d=google.com; s=arc-20160816; b=yWGKRprX/D4PBWWWzm4HKvQVhszhCZYJafGDrfldVGX7XU8SZeJMiDYo6nFuZZGNmn kLoCTiA+RdQ745oarkddAf1stkiX/Bd6FlltN/MSl+HlWTMDpEBgBQ6+rJGUjGVv46/G 6XnaUfGYWo/eM9nB1/NPwD1mdEzJv8LBE7u63IETKcpz8yv67xbKLExXdZ9AoiTVDu2j ipFuA8ThVsPTqCDxN0PiA6HG17a9amud6DXzr6TBtymjpkad4iGkb5lfLrQAwhKh1P2b es9nvEUfZAwFaN01oGxcR52n4P7BQarGVjceoX1voE0cTYcgM7XxxeStIun7RNyOExA6 mNpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=k534WYxTyqTlyHj7z7jLQha4qD6Bajp/eHQMyN5NOoA=; b=M23v42HdT0YZ415bDAniZ1ilhhsJPiImM6ZA8aD+6d2k5tUOi+MeJMBVj/G52QRw6h mXhJ/dwndbtFmFbSqy6swn1Dn20ngepc9y5WO/KJx9UatWAhkbZM6PBGYOxbiALld5Pd sBC1nCzfA9iIv1G1CglvxYjSN61+oxM76xxjUofoyyQ7WqnGkHht7ozhrkuGPlItGzql vrjyzouZugUKTBqnI2Ww5eMhpyiWhVttUma+MO08L/+g0OqJOcXiCv52BPWgvmW4Iw1B +RYi1z1xFprHH6wSsyg23H6sW0Iich/uV7nt4XyTREtxfOU7DpqfKAT280UpFRu47k8b MdCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MgXeV2dV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi13-20020a17090b1e4d00b001e67c8309a5si19137331pjb.9.2022.06.09.05.48.39; Thu, 09 Jun 2022 05:48:55 -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=@gmail.com header.s=20210112 header.b=MgXeV2dV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245533AbiFIMgi (ORCPT + 99 others); Thu, 9 Jun 2022 08:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245523AbiFIMgg (ORCPT ); Thu, 9 Jun 2022 08:36:36 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6392317D for ; Thu, 9 Jun 2022 05:36:34 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id b8so14337313edj.11 for ; Thu, 09 Jun 2022 05:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k534WYxTyqTlyHj7z7jLQha4qD6Bajp/eHQMyN5NOoA=; b=MgXeV2dVHyvEW7LeJK/ajtzstgF8A5WVQUJ8cPJnZ2u4eJ+0stlTeRIhmaT1cTPWnc iZ2z4zTTHYKo6r4VCpwfTJ1iyy3qVV9HTXJtpMigBRNLYl9rT/v03TuylqqWwa6WCdfN XX48OFchMwDtv0VxjeQ3xKkZwnpMhhd+gDEcAmVnPjeMkQcS2TBvOL451TYSnb5D+McB zdTFX78PQLNnAFHJXb1R50Cn1O6GB1Lg9R/FzUEv223GbW1iOlw9K5i8QNE+MU7qcmhv AVGopRE7PNT1M7ymx3f3xVyWH19aBSdn60DInvLsl7uie6MarsqH8qE2n6iteadwwYkI qF5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k534WYxTyqTlyHj7z7jLQha4qD6Bajp/eHQMyN5NOoA=; b=cj+Sh0A9D4M5Q8Sb/MjE34bf7ZtRfDJYKDVbPUEtbBxlDj6PAuc+6zSnjXk89LXvET gjxlKxnQLnm1YXwvg23OSPryAKJiG9oboLyAJdk5VxFtx9wVVhh43C/e5NcmpTDckCR3 XHV6ThI77pbMjVUDTog97CMjtYHKglekYpC99aiLQQKbroED0IeBGWHvQo0aS7nDsWOv sNW+D2toBY6vjLj5lmcjfnzBmwueSjFXHbXd6Lmwx9tDb7JvN81tAfFQdD2sCWOZOmSs ZTSL5ux+21jyoupWJMymHOKjEmeJwGVl0yLTZeBcGQxamLAUUeaQ33n6rNcsFwzBjT1L iwBQ== X-Gm-Message-State: AOAM531/0eRP58/td//PXdkiPDGLEBiqVhwNluL4RO4i5hRYjOEBohyG RrgeenemHfdKg6dm5HAYjuLPekhH23TQbw4w0R0= X-Received: by 2002:a05:6402:2554:b0:42d:ee79:559d with SMTP id l20-20020a056402255400b0042dee79559dmr44846992edb.175.1654778192904; Thu, 09 Jun 2022 05:36:32 -0700 (PDT) MIME-Version: 1.0 References: <20220607093449.3100-1-urezki@gmail.com> <20220607093449.3100-4-urezki@gmail.com> In-Reply-To: From: Uladzislau Rezki Date: Thu, 9 Jun 2022 14:36:22 +0200 Message-ID: Subject: Re: [PATCH 3/5] mm/vmalloc: Initialize VA's list node after unlink To: Baoquan He Cc: Andrew Morton , Linux Memory Management List , LKML , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Oleksiy Avramchenko Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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? > 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. -- Uladzislau Rezki