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 X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E0E6C43461 for ; Thu, 10 Sep 2020 17:55:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 685A820BED for ; Thu, 10 Sep 2020 17:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="UEmeuRPj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 685A820BED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A5AE56B0087; Thu, 10 Sep 2020 13:55:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A0B046B0088; Thu, 10 Sep 2020 13:55:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 921C96B0089; Thu, 10 Sep 2020 13:55:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 7A2076B0087 for ; Thu, 10 Sep 2020 13:55:00 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 377C28248047 for ; Thu, 10 Sep 2020 17:55:00 +0000 (UTC) X-FDA: 77247902760.09.soup70_4e0049f270e8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id E8F1E180AD80F for ; Thu, 10 Sep 2020 17:54:59 +0000 (UTC) X-HE-Tag: soup70_4e0049f270e8 X-Filterd-Recvd-Size: 3952 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 10 Sep 2020 17:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RsvPI5m+FjpWX5fj8al0e1CX/ws2JMjmmI6P92VoUcU=; b=UEmeuRPjW2XAWO7fcX7kCbMatU r5+iZElhFmnjGgoKpLYvQnsSG84Aa2ImVCh2j6aS7mM61szyX1opB1whDrIkXfTMYcYpIxLLiJKAW YZ35JatKIbhUJFRFORyWDfJ71pkp1L1GF3Mx4ZJT6RcL3fiAQ1NWqR96SEskfmSMuh33PTgtMIbfE ObhCAqrN1TDaakshIbgKYMNwoWu1qUtBcpdJLwySv57JBB7B8El2SNF8oQhRuNXRHALgxipSfyDq5 soOOmUwp6+Ioc34IFO9DRKOELr1TR2c6++jMlQnheNWKYWcUw2XxdN4FKylKj/suM9h+58nYDz6He NUuDkWhg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGQmY-0002cb-RV; Thu, 10 Sep 2020 17:54:51 +0000 Date: Thu, 10 Sep 2020 18:54:50 +0100 From: Matthew Wilcox To: akpm@linux-foundation.org Cc: mm-commits@vger.kernel.org, songliubraving@fb.com, kirill@shutemov.name, cai@lca.pw, linux-mm@kvack.org Subject: Re: + xarray-add-xas_split-fix.patch added to -mm tree Message-ID: <20200910175450.GV6583@casper.infradead.org> References: <20200904172353.gfJQP%akpm@linux-foundation.org> <20200908220644.GA6583@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200908220644.GA6583@casper.infradead.org> X-Rspamd-Queue-Id: E8F1E180AD80F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Tue, Sep 08, 2020 at 11:06:44PM +0100, Matthew Wilcox wrote: > On Fri, Sep 04, 2020 at 10:23:53AM -0700, akpm@linux-foundation.org wrote: > > From: Andrew Morton > > Subject: xarray-add-xas_split-fix > > Can I ask you to add another -fix patch? ... updated to also fix the documentation. Thanks, Mauro. commit 71c3da6f580dc6ce98143d92da768c85638d4518 Author: Matthew Wilcox (Oracle) Date: Tue Sep 8 17:55:22 2020 -0400 fix xarray split diff --git a/lib/test_xarray.c b/lib/test_xarray.c index 16fe5adcac62..8262c3f05a5d 100644 --- a/lib/test_xarray.c +++ b/lib/test_xarray.c @@ -1524,6 +1524,9 @@ static void check_split_1(struct xarray *xa, unsigned long index, } XA_BUG_ON(xa, i != 1 << order); + xa_set_mark(xa, index, XA_MARK_0); + XA_BUG_ON(xa, !xa_get_mark(xa, index, XA_MARK_0)); + xa_destroy(xa); } diff --git a/lib/xarray.c b/lib/xarray.c index ff3652657bd8..b573db455c43 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -973,10 +973,11 @@ static void node_set_marks(struct xa_node *node, unsigned int offset, xa_mark_t mark = XA_MARK_0; for (;;) { - if (marks & (1 << (__force unsigned int)mark)) + if (marks & (1 << (__force unsigned int)mark)) { node_set_mark(node, offset, mark); - if (child) - node_mark_all(child, mark); + if (child) + node_mark_all(child, mark); + } if (mark == XA_MARK_MAX) break; mark_inc(mark); @@ -984,8 +985,18 @@ static void node_set_marks(struct xa_node *node, unsigned int offset, } /** - * Allocate memory for splitting an entry of @order size into the order - * stored in the @xas. + * xas_split_alloc() - Allocate memory for splitting an entry. + * @xas: XArray operation state. + * @entry: New entry which will be stored in the array. + * @order: New entry order. + * @gfp: Memory allocation flags. + * + * This function should be called before calling xas_split(). + * If necessary, it will allocate new nodes (and fill them with @entry) + * to prepare for the upcoming split of an entry of @order size into + * entries of the order stored in the @xas. + * + * Context: May sleep if @gfp flags permit. */ void xas_split_alloc(struct xa_state *xas, void *entry, unsigned int order, gfp_t gfp)