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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 67803C352BE for ; Sat, 18 Apr 2020 20:15:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FB7F221F7 for ; Sat, 18 Apr 2020 20:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587240913; bh=QodNS7jQf/8r+MmfUSCPPvm6Xo+BZcg9ZG7LxYlG7/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=twyhM4xX9vH2cGO4V5xZ8aE9J0MRhi7EWDQYX9AmOauJkL69hV7svsWgGMdfRIxfp ITAEMAktiE4yZ1Q6ceRTzr+HFPN9IHYxyLJMWH311axLM5OsSeupHYztsqvevGc4cC ugmmj8tMoTvQ+WxmLwfzdNxdPG/0bawsdFiCtN/c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbgDRUPM (ORCPT ); Sat, 18 Apr 2020 16:15:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:53438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727927AbgDRUPL (ORCPT ); Sat, 18 Apr 2020 16:15:11 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E0B221D93; Sat, 18 Apr 2020 20:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587240910; bh=QodNS7jQf/8r+MmfUSCPPvm6Xo+BZcg9ZG7LxYlG7/0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=1G588uZCL+ntQx9O37pEdgratWOEUiY0XgcqjouFjHTDk60Q8SZ9dO5R43Wwu2Sri GuBcuHolcKslqCPkUrwfw8MN68Fl2XZQtOMBDOo4M7XhcydM4fRtwAPBvclYdJV7pX n9omhF7RhQuo8BbfifKQWybDRWiHpobeddl4xmKo= Date: Sat, 18 Apr 2020 13:15:09 -0700 From: Andrew Morton To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Manfred Spraul , Davidlohr Bueso Subject: Re: [PATCH] ipc: Convert ipcs_idr to XArray Message-Id: <20200418131509.fb3c19bf450d618be797c030@linux-foundation.org> In-Reply-To: <20200326151418.27545-1-willy@infradead.org> References: <20200326151418.27545-1-willy@infradead.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Mar 2020 08:14:18 -0700 Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" > > The XArray has better loops than the IDR has, removing the need to > open-code them. We also don't need to call idr_destroy() any more. > Allocating the ID is a little tricky due to needing to get 'seq' > correct. Open-code a variant of __xa_alloc() which lets us set the > ID and the seq before depositing the pointer in the array. hm, this goes rather deep. Manfred & Davidlohr, are you able to run this through some testing? > > ... > > --- a/ipc/util.c > +++ b/ipc/util.c > @@ -104,12 +104,20 @@ static const struct rhashtable_params ipc_kht_params = { > .automatic_shrinking = true, > }; > > +#ifdef CONFIG_CHECKPOINT_RESTORE The code grew a few additional CONFIG_CHECKPOINT_RESTORE ifdefs. What's going on here? Why is CRIU special in ipc/? > +#define set_restore_id(ids, x) ids->restore_id = x > +#define get_restore_id(ids) ids->restore_id > +#else > +#define set_restore_id(ids, x) do { } while (0) > +#define get_restore_id(ids) (-1) > +#endif Well these are ugly. Can't all this be done in C? > > ... >