Received: by 10.223.185.116 with SMTP id b49csp853173wrg; Sat, 3 Mar 2018 08:59:02 -0800 (PST) X-Google-Smtp-Source: AG47ELvO+XmZew+vgVcBOgkh0wBDp40SE/x8DACpemu8AE2jVy5U8yu+LqtMU4aFFy4Kcz6cY1Dn X-Received: by 10.99.189.82 with SMTP id d18mr7771531pgp.172.1520096342489; Sat, 03 Mar 2018 08:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520096342; cv=none; d=google.com; s=arc-20160816; b=ope830Qr66HlIlUf8ugxhkP5BplVleL+McMrKmVyQhKQ/wBgp7GSjstMhLTHMzaPe4 YeBXYKt4vnGqLbYAln6jb33nNgHww1MY5sJSnk4EYA99PgjZ7ajBzEfC3Y+QCrqAFXYf /FX7MYl0E6ub7YneG+D4RLN/LxOGgkWXMzichSpFL5dsiBaE7xm/OtCIWhYj8erWNA7D orRC9NFxPZx3fXzzROe7zgEEfP3d6iEErFQYLaMX0Vm5lyaEhcWASSqIXIaPaRIX1IwI yw/1mnZdYbEU/ECelLpNxbkPxC4sj3YEwoPydDynp4OJ0XS2E7cef0QOvXzgOSS+ZigJ IWjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=CgHa2TEVcHLOkLiApP6Zifas2VnIrNzP6EUc/chldSs=; b=sbKB45Iz/wH/gO4ok5tso+4xhtryGPJuHhYTLVCacKl7ExF+u1aGJBvvNAmTjVS8gk Xuctc9Qv+LA55lQ7bhEtzvQgIRE6aj/UE/Nl+wZOjvff1giGRptJ9qArDGX6+JHyIcUr PrGhcYiVv9L7mNSO8WGfCtbw97hgr+51BigiSyJFm6MZxjI20bz+acynDcGacrg/4ftU NB0xhJ80zmY4wZXdAHLsZRBxreK+92iBlOeRclU9WxzcseSD9zghVJZva5YAIdZEXCr7 5Npmhf/GkbPhOYHbkBbyqcOK3wq8dxvBgjMv/2/rf+XF9CImtzoVNCY3hvnPefGCqA1s N45w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uGB3L/eQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24si1334139pfn.336.2018.03.03.08.58.34; Sat, 03 Mar 2018 08:59:02 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=uGB3L/eQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbeCCQ5e (ORCPT + 99 others); Sat, 3 Mar 2018 11:57:34 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:38978 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbeCCQ5d (ORCPT ); Sat, 3 Mar 2018 11:57:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CgHa2TEVcHLOkLiApP6Zifas2VnIrNzP6EUc/chldSs=; b=uGB3L/eQeFJ89pm0mFUgKn8Bk uEsV73vj7m/AV4NTbvgfmNd2S6SGufhRaCos0jes3AxqcMLZ2H+tAyctsN+yfbQ2CW3QSjVY5bfIt ILfZBXGpb0v5sSpqVDxhVdw/ojW0CfYm4AzwMYDj/D68bLtPke/iYSevkdcBdghPjOUOJhyOCH1qd vVkMvIgfrvV5val/mC2V+XsCXsLhjZMGodvaGPLpw2emKwDl06I5JwE5EzynyVCVrr8xUj0Me1p0s oPkt/Z/gAjlk5pUif5kMH1fy0yJc3oos7kK3XofmNecE1kyRn5EyKpqhoji/ZIAv21EkhA2YPTnM5 vZompq6VA==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1esATQ-0001Ue-F1; Sat, 03 Mar 2018 16:57:28 +0000 Date: Sat, 3 Mar 2018 08:57:28 -0800 From: Matthew Wilcox To: Jeff Layton Cc: Andrew Morton , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 08/61] xarray: Add the xa_lock to the radix_tree_root Message-ID: <20180303165727.GA29990@bombadil.infradead.org> References: <20180219194556.6575-1-willy@infradead.org> <20180219194556.6575-9-willy@infradead.org> <1520088922.4280.47.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520088922.4280.47.camel@kernel.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 03, 2018 at 09:55:22AM -0500, Jeff Layton wrote: > On Mon, 2018-02-19 at 11:45 -0800, Matthew Wilcox wrote: > > From: Matthew Wilcox > > > > This results in no change in structure size on 64-bit x86 as it fits in > > the padding between the gfp_t and the void *. > > > > While the patch itself looks fine, we should take note that this will > likely increase the size of radix_tree_root on 32-bit arches. > > I don't think that's necessarily a deal breaker, but there are a lot of > users of radix_tree_root. Many of those users have their own spinlock > for radix tree accesses, and could be trivially changed to use the > xa_lock. That would need to be done piecemeal though. > > A less disruptive idea might be to just create some new struct that's a > spinlock + radix_tree_root, and then use that going forward in the > xarray conversion. That might be better anyway if you're considering a > more phased approach for getting this merged. Well, it's a choice. If we do: struct xarray { spinlock_t xa_lock; struct radix_tree_root root; }; then the padding on 64-bit turns that into a 24-byte struct. So do we spend the extra 4 bytes on 32-bit and have the struct the way we want it to look from the beginning, or do we spend the extra 8 bytes on 64-bit and have to redo the struct accessors after the conversions are complete? I chose option (a), but reasonable people can disagree on that choice.