Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1170571imu; Fri, 11 Jan 2019 16:40:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN55m/CUMu/jGBgTobzXVTmFK94G6B+XbO6aq5F0LWI/YqiI9Lk7os4RSzHCL/rJ9FilhazE X-Received: by 2002:a63:3d49:: with SMTP id k70mr15330320pga.191.1547253641528; Fri, 11 Jan 2019 16:40:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547253641; cv=none; d=google.com; s=arc-20160816; b=TJ25WNSgNMb0dxF/19b3Q6xZNdQpZ170080tMhkM8Ogjsz2dy4Q6CN7hFp2jmSLjkI 7FlIqAj0OEDAgyByHspNDgvmjFDXO1aCIo5SDTqYIPcxovbpICZbSok9pSd7qJiDnpEI f6otc32D7iXKpG8FnvTd09fkgLNTz98/2WmIXl2cnEzfeLZ56pK69r/A98jyADoaXRuG YTsoEEwvYmmkxv44HRPbg+t6xKMTJDax8yVq067FlbSSC+1memzamRogOQrtbqCJtkkz o0pSA0mJejxXdu9Y6Gk7nWccbPElTgPHpxIpdLoMfKE/GRAoff2e1FhfY+9ZepTFmDBw 55jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=SrTs9CW5JbaBlOpI50AMxBi8fT2NHsqup6Y3oDTcQiQ=; b=r7tbwUks3zn/mmQJNF8Pi5Hfz8xI9rf/BKfwP598LKfg9w3TpbRjkOUS+o/RVp2mv5 wjUNU5jcqcpLA1rUeGr0VWVd8ntSKIf3BeLuRyyouh3fRm9mWO7NITbAjy0ts2jNBuLZ T1bOiyqEs9zxUFrvEJRvho8EpxuEU53RkMsxn3NA6axWU6CBmoh4WF/C2XmG20pI191K 51XEQgcR5CuGeQsSApZ8+7K8NI4ii8hlbXi5e4K8D/PGr//ANzCGXvOkufB/IQsI/6Rk lg0DemqKvnSONOw2+Oee9avkeGF7Hh9c1C1fljmamwlUyRqiH8NhW/PtLMmoTGM0FMvI wyFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.ch header.s=default header.b=tsJOvhb2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.ch Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23si9427453pgk.312.2019.01.11.16.40.25; Fri, 11 Jan 2019 16:40:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.ch header.s=default header.b=tsJOvhb2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726440AbfALAjW (ORCPT + 99 others); Fri, 11 Jan 2019 19:39:22 -0500 Received: from mail-40130.protonmail.ch ([185.70.40.130]:61943 "EHLO mail-40130.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726254AbfALAjW (ORCPT ); Fri, 11 Jan 2019 19:39:22 -0500 Date: Sat, 12 Jan 2019 00:39:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=default; t=1547253558; bh=SrTs9CW5JbaBlOpI50AMxBi8fT2NHsqup6Y3oDTcQiQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=tsJOvhb2jyHLpYTz8chR59WCy2qENkMWLKOt2xdO9IIVWrFmpE5/BqMSTDdBvkpot zzdV3lDZeBs6qIDaLIexstK1wRLlpYUenx0HahTcuyWdu1aoBfBkMGOtHQOhkWUxeA CVdw7OFZmhQvxcQipggpXmvtwwPBJXrXldNOERug= To: Qian Cai From: Esme Cc: Matthew Wilcox , "akpm@linux-foundation.org" , "jejb@linux.ibm.com" , "dgilbert@interlog.com" , "martin.petersen@oracle.com" , "joeypabalinas@gmail.com" , "walken@google.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Reply-To: Esme Subject: Re: [PATCH v2] rbtree: fix the red root Message-ID: In-Reply-To: <463fa1f6-4ee6-ef4d-431c-3c392c827792@lca.pw> References: <20190111181600.GJ6310@bombadil.infradead.org> <20190111205843.25761-1-cai@lca.pw> <20190111231652.GN6310@bombadil.infradead.org> <463fa1f6-4ee6-ef4d-431c-3c392c827792@lca.pw> Feedback-ID: pQGzDYT_k6dzic_kf3kwsxmTXzjnqMJxtC9J3KGyZBepPHdXRBM0BHuwPfpm1pFdJLAMwtJT5KKNaGlRVnFRQw==:Ext:ProtonMail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=7.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I've been out today but return home tomorrow and can test any suggested fix= es, or with different kernel settings. Just let me know. Esme Sent with ProtonMail Secure Email. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, January 11, 2019 7:18 PM, Qian Cai wrote: > On 1/11/19 6:16 PM, Matthew Wilcox wrote: > > > On Fri, Jan 11, 2019 at 03:58:43PM -0500, Qian Cai wrote: > > > > > diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c > > > index b7055b2a07d3..afad0213a117 100644 > > > --- a/lib/rbtree_test.c > > > +++ b/lib/rbtree_test.c > > > @@ -345,6 +345,17 @@ static int __init rbtree_test_init(void) > > > check(0); > > > } > > > > > > - /* > > > - - a little regression test to catch a bug may be introduced by > > > - - 6d58452dc06 (rbtree: adjust root color in rb_insert_color() o= nly when > > > - - necessary) > > > - */ > > > - insert(nodes, &root); > > > - nodes->rb.__rb_parent_color =3D RB_RED; > > > - insert(nodes + 1, &root); > > > - erase(nodes + 1, &root); > > > - erase(nodes, &root); > > > > That's not a fair test! You're poking around in the data structure to > > create the situation. This test would have failed before 6d58452dc06 to= o. > > How do we create a tree that has a red parent at root, only using inser= t() > > and erase()? > > If only I knew how to reproduce this myself, I might be able to figure ou= t how > it ends up with the red root in the first place.