Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp801209rdf; Fri, 3 Nov 2023 16:13:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFte5U7jV9cHRk5XIzzt+myKmfy1g/ZaNUInVH92M5KjRHgnGiPpWOeHG14VHU4tx97PFtN X-Received: by 2002:a05:6830:4412:b0:6b9:e35e:8dd with SMTP id q18-20020a056830441200b006b9e35e08ddmr28320689otv.2.1699053213087; Fri, 03 Nov 2023 16:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699053213; cv=none; d=google.com; s=arc-20160816; b=XELV8dUypT63EKcnLQwLKXSYnGq8m9D15/TZ/ODH0JPEgZsYooyD6iNSSmoGz2dmN2 ZJR+jAOyOo2Zcz4MdDppkIq375PaS4EgNXfqweX76pzkKTr7kACWLzYRAqDCv2DAXya/ CWUbwlEEfH9DDKoi5ih0JvGeIaKYEkk91dcEXFymWFf2GCCZI7mBIevOTwKrv6wGAkwD iUIislaFohyuwrs2mZX732IAHm23wNdvNSDKHUTLqS4Gd939yA2MliMdWLUR0lX6S6WU IayVhMIJyWVakOvqxyf8dGwAgKC+FQ5CQY75lauoagZ+ZwPKRg/OlUNTno80TPvH0Qj1 tYaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:mime-version :content-transfer-encoding:content-id:content-language :accept-language:in-reply-to:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:dkim-filter; bh=oHsO3OHKphhNYc2KKcSi9BXbYPXz/A7ETlyML/Q/00I=; fh=wq2dFTgqBetHCM369K3nSWx9+Ek5C8S2/IOktMpM8t0=; b=oYaW0w/tuC6jN1EAJ3hVudipUPg4njf520Clf2lqtdo6OXMwsZcrtAsdd/Mwxj+bY0 07dwYUYXQgN0cqHuNnhCSB53pPL7HeSrMC7T5wpPg9qhRbcIem/Dejbr7saHrN3fu/ds 24P/sp4LNmJi3MleUUhqDRUkRoi1IQbfxEkre4CAXnNCCI/H9mzinmuQQQjC2ymioc28 DWjg8eNKA21Pei5ioeLS4dgQ5d9yY8rJWgmE9QInRhdbWF6s8KW24yeui21i3HxYu2hR x1c5pjEXl+Myx93i6Nic8sy3avJftq+/JEJa/RV0ihGzWuXbAWeAR+z4NW1AKTncyRSV grQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=LYEp8QYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y40-20020a056a00182800b006b4c1a2085fsi2453860pfa.168.2023.11.03.16.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 16:13:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=LYEp8QYz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 161608020715; Fri, 3 Nov 2023 16:13:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbjKCXNU (ORCPT + 99 others); Fri, 3 Nov 2023 19:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231259AbjKCXNT (ORCPT ); Fri, 3 Nov 2023 19:13:19 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D9A4D52 for ; Fri, 3 Nov 2023 16:13:13 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231103231301euoutp02c66486157897baf37cb304254dd918eb~UP93nUiR50220302203euoutp02M for ; Fri, 3 Nov 2023 23:13:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231103231301euoutp02c66486157897baf37cb304254dd918eb~UP93nUiR50220302203euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1699053181; bh=oHsO3OHKphhNYc2KKcSi9BXbYPXz/A7ETlyML/Q/00I=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=LYEp8QYzPDwiyxo0vJcR59grQQPKZw/jJGYxkBRhA1+xpmy1hXxufOiNL4gCdRgD1 baYL7KT4WACekSJU8eKAZUKlMSzZXdaMfjFIh/1eRzN6rxECFT4MjS44DLRRnLDAkk 79Fz/sGs8mH+Nb/lyRW47yIBA8MgRI6dHi4XOfPk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231103231301eucas1p192942ceb0cb6ebb63aee326a6f959e2d~UP92_LwPe0263002630eucas1p1C; Fri, 3 Nov 2023 23:13:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A5.2B.42423.C7E75456; Fri, 3 Nov 2023 23:13:00 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231103231259eucas1p18e529693e4b47b5e0623271bf319a25f~UP915_fmj2687926879eucas1p1Z; Fri, 3 Nov 2023 23:12:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231103231259eusmtrp22251fecfaf13e569c815d97a704cbb52~UP911BCNL1325313253eusmtrp2c; Fri, 3 Nov 2023 23:12:59 +0000 (GMT) X-AuditID: cbfec7f2-a51ff7000002a5b7-2a-65457e7cccea Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C8.69.10549.B7E75456; Fri, 3 Nov 2023 23:12:59 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231103231259eusmtip2247fb3c78e71787af6a52bb65a4d74c0~UP91nknSd2294222942eusmtip2T; Fri, 3 Nov 2023 23:12:59 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 3 Nov 2023 23:12:58 +0000 Received: from CAMSVWEXC02.scsc.local ([::1]) by CAMSVWEXC02.scsc.local ([fe80::3c08:6c51:fa0a:6384%13]) with mapi id 15.00.1497.012; Fri, 3 Nov 2023 23:12:58 +0000 From: Daniel Gomez To: Matthew Wilcox CC: "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [RFC PATCH 01/11] XArray: add cmpxchg order test Thread-Topic: [RFC PATCH 01/11] XArray: add cmpxchg order test Thread-Index: AQHaCePk2/Onfe3eA0ia1dQGCoKrA7BhNHAAgAgOVAA= Date: Fri, 3 Nov 2023 23:12:58 +0000 Message-ID: <20231103231254.bytltpzsc2qojlbw@sarkhan> In-Reply-To: Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [106.110.32.103] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKKsWRmVeSWpSXmKPExsWy7djP87o1da6pBtNnW1nMWb+GzWL13X42 i8tP+Cyefupjsdh7S9tiz96TLBaXd81hs7i35j+rxa4/O9gtbkx4ymix7Ot7dovdGxexWfz+ MYfNgddjdsNFFo8Fm0o9Nq/Q8rh8ttRj06pONo9Nnyaxe5yY8ZvF4/MmuQCOKC6blNSczLLU In27BK6MzUd3Mxac5anY13GcsYFxJVcXIyeHhICJxInn79i6GLk4hARWMErs3HedBcL5wijR On8KE4TzmVHi9IJnLDAtzy/1MYLYQgLLGSXObGWCsIGKjn2Og2g4zShx99p9Jri5M+/sYwOp YhPQlNh3chN7FyMHh4iAhsSbLUYgNcwCR1kllqzdBLZBWMBWYv3WOcwgtoiAncTDWy/ZIWwr iVdfroPVsAioSLzY/hOshlfAVGLOtMVgNZxA1y3d/gnsIkYBWYlHK3+BxZkFxCVuPZnPBPGB oMSi2XuYIWwxiX+7HrJB2DoSZ68/YYSwDSS2Lt0H9bGSxJ+OhYwQc3QkFuz+xAZhW0o0nPwM FdeWWLbwNdQ9ghInZz4Bh6OEwFQuibVL50Etc5E4enA31BHCEq+Ob2GfwKgzC8l9s5DsmIVk xywkO2Yh2bGAkXUVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+7iZGYMo7/e/4px2Mc1991DvE yMTBeIhRgoNZSYTX0dslVYg3JbGyKrUoP76oNCe1+BCjNAe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WYhWT0L SfssJO2zkLTPQtK+gJF1FaNIamlxbnpusaFecWJucWleul5yfu4mRmBK23bs5+YdjPNefdQ7 xMjEwXiIUYKDWUmE19HbJVWINyWxsiq1KD++qDQntfgQoykw8CYyS4km5wOTal5JvKGZgamh iZmlgamlmbGSOK9nQUeikEB6YklqdmpqQWoRTB8TB6dUA1O6tFrHju1ue1rd91ewfJFm2DIr SUL3Qctk7RUJ995WNb3ewfrr8O1eg/pEftWEjzqnNzUb3lVbJGAoeVv4yimVgs+tZWVb/299 uZVhIvOnDse8ZGmfZRMDG0PzL8+M0d9+89ix+SzvGUqjmK6efXHmynkP2XkCW97HBDh2Seuf cv9o9Tn2/6xnZ5/X/Jv2Rscq+U2b4ZHlCxy3as/2MZp5V+HGXVMedpvPujeUilremL5k/HBH aYbB/ijmMw6zI61Y3IMqWe5Gsr2M2sJQnXjEvGF52AG7Nyfs3ef9NeXdvG1DduusvZ2sUtfj 75Z6frBnenpb7Emiwdsz7Rb9J3st3v5b/jC7O2uZFrPo70dKLMUZiYZazEXFiQChzl1/8gMA AA== X-CMS-MailID: 20231103231259eucas1p18e529693e4b47b5e0623271bf319a25f X-Msg-Generator: CA X-RootMTR: 20231028211538eucas1p186e33f92dbea7030f14f7f79aa1b8d54 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231028211538eucas1p186e33f92dbea7030f14f7f79aa1b8d54 References: <20230919135536.2165715-1-da.gomez@samsung.com> <20231028211518.3424020-1-da.gomez@samsung.com> <20231028211518.3424020-2-da.gomez@samsung.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 16:13:30 -0700 (PDT) On Sun, Oct 29, 2023 at 08:11:32PM +0000, Matthew Wilcox wrote: > On Sat, Oct 28, 2023 at 09:15:35PM +0000, Daniel Gomez wrote: > > +static noinline void check_cmpxchg_order(struct xarray *xa) > > +{ > > + void *FIVE =3D xa_mk_value(5); > > + unsigned int order =3D IS_ENABLED(CONFIG_XARRAY_MULTI) ? 15 : 1; > > ... have you tried this with CONFIG_XARRAY_MULTI deselected? > I suspect it will BUG() because orders greater than 0 are not allowed. > > > + XA_BUG_ON(xa, !xa_empty(xa)); > > + XA_BUG_ON(xa, xa_store_index(xa, 5, GFP_KERNEL) !=3D NULL); > > + XA_BUG_ON(xa, xa_insert(xa, 5, FIVE, GFP_KERNEL) !=3D -EBUSY); > > + XA_BUG_ON(xa, xa_store_order(xa, 5, order, FIVE, GFP_KERNEL)); > > + XA_BUG_ON(xa, xa_get_order(xa, 5) !=3D order); > > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(FIVE)) !=3D order); > > + old =3D xa_cmpxchg(xa, 5, FIVE, NULL, GFP_KERNEL); > > + XA_BUG_ON(xa, old !=3D FIVE); > > + XA_BUG_ON(xa, xa_get_order(xa, 5) !=3D 0); > > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(FIVE)) !=3D 0); > > + XA_BUG_ON(xa, xa_get_order(xa, xa_to_value(old)) !=3D 0); > > + XA_BUG_ON(xa, !xa_empty(xa)); > > I'm not sure this is a great test. It definitely does do what you claim > it will, but for example, it's possible that we might keep that > information for other orders. So maybe we should have another entry at > (1 << order) that keeps the node around and could theoretically keep > the order information around for the now-NULL entry? Thanks Matthew for the review. I'm sending a separate patch with the fixes and improvements on the XArray cmpxchg test.=