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 76B8EC43334 for ; Thu, 9 Jun 2022 12:36:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09FD48D0011; Thu, 9 Jun 2022 08:36:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 029408D0006; Thu, 9 Jun 2022 08:36:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE6388D0011; Thu, 9 Jun 2022 08:36:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C987F8D0006 for ; Thu, 9 Jun 2022 08:36:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A3A8FECE for ; Thu, 9 Jun 2022 12:36:34 +0000 (UTC) X-FDA: 79558645908.18.B092ABF Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf22.hostedemail.com (Postfix) with ESMTP id 490CEC0080 for ; Thu, 9 Jun 2022 12:36:34 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id d14so5457889eda.12 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=F593CSKu2d01tgBPJ6NK1Wx5gTHr2ocAGTlX8zYfyzYpVNhNb0YrkZ7fZ6zf4TD3nt Ndxs6MUNiQeXt8LC79w1PKIc+Y+PkMYlVRMK3lH5m0y4vvdnFbqxjmWHIZU79H1zFb5R dKqjw/vpiyeOBtvxwEkL4EXBD6PTf2sqrfj4cRlSpTYmKKbcdHxlxIKgruSMfvGRKrKB qEmkaeCsnmxphfRe8vZq47oYqdDl5Ic3GmbtFyr+UsummvoQLLV0yC0x8Ac88vetML9Q teWXK3Mlv4tKZr9wL6PjyDY0xL5AXT/g80ZDdQvwqkcVMOHWyusEqwzv0ymDMrPrzbZh 7aQg== X-Gm-Message-State: AOAM533mJAS7JH9hM3HLtSn2ed100oPQNEe77qqbq8XlI9taOX/y/Ez3 6DujPBBPDEgF223jeJ7WK1W4PW7i3rVw57S2O9A= X-Google-Smtp-Source: ABdhPJzsviw3XcPKRI4vJ4d/dcGwcAAqvFVqEieN/lnYFS2vpDL7wAY96siZ2e9FlBbq2ALsYxWNBiUa8PAYssEiZkc= 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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654778194; a=rsa-sha256; cv=none; b=W070Ylld9bkDNxZiiJ5zxyFHqXGnuhcj+A4GWjaHA5KlRytDiw96ljw4p9BVTj3vwuJbVn dk2pmlvOVltdDN58JTkOWr8taErwhINfj8a+cCJk9H4tVxBLvBoexwtpmZfaW+6DpmQ/CU 4RqXhc6MjcIpkTR9T9dGDKHULZA9kE4= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MgXeV2dV; spf=pass (imf22.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654778194; 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=k534WYxTyqTlyHj7z7jLQha4qD6Bajp/eHQMyN5NOoA=; b=UtNyzGSOdzl5KcWnsTZcIjpuMMkbSGiBo0jQa/I+NhZghgwOkqmCLBKMOHHQVs26l5XPlh B2UecGJ98COzYR/vZitgcqlsivSMnLKmrcBvdrpZJI1/lYp5Wvn/BBZg0hQD1uGQzXoG5B Px+l5KCLurxu7s6ImFvo0DXKIYMdW1g= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 490CEC0080 X-Stat-Signature: wx5jbngqcexkzkt3okikpp1s9bw6gy3y X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MgXeV2dV; spf=pass (imf22.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=urezki@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1654778194-855057 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/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