Received: by 10.192.165.156 with SMTP id m28csp2461284imm; Thu, 12 Apr 2018 14:53:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Ci6c+ohkxp5luOmsELu0riQmVKPV9LrM5FS5mKP6PYJqx38piCM35nSUJgnHOjBjhDCTl X-Received: by 10.98.159.200 with SMTP id v69mr9094545pfk.230.1523570035011; Thu, 12 Apr 2018 14:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523570034; cv=none; d=google.com; s=arc-20160816; b=Jhb01ig0qYQy6sOEzBkCcI2co/9KdLKLKj30LWZAtGDDkaB/sxSJofDp779abt1JzG lclsW/NnyEskhl4uuOw3z+ABKUhksrWKbRwUAI7eMeZhr8k0sPPjFuWpygU4V+1pdueo tiLG1HFhsSAYXlCygL5dEyDLM2pY5s5y80PT09WMt0y9PeOGJDzK3EeDkuJIyIn23d7p O/NXNqfy8+E5VNCWAiAoizuH3y8WY7zKJlJGXF6omnTvG/rWvuc1B5C7zxsKZmJCTeRX ug03FXu4F0NoSorX1EZ13EVhdqY28A4JzvBxRtJlyJm8gNPCaAp504e3PhXOpPfd3G35 SDiQ== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=EMsk8lrTQSZfUeipbnCRp5jfEaYCHZDQTlL2aq2cX0k=; b=eINNOBDcsachqKT3WCcY5FMjVwbf0MLqBeQmH/CCLxsvn7b4a5zphopzOB+sAxL9Gb 16OyVfeQ6/gSNd4w5gRF87chRzGyRrwyCfrWYDbuE1172XCjyieTverP6JEeuzAzNhCz ZaAtzFDlUUr/fALSaFHb7/BodcIjZaRYw515Gu0igY0UePInHT5FL4qhT36BGTZyu3U3 P5IbWILLjCD1giot83r45/JJAF/ftOEhL+56qRtbiiy+9udTGK7dZSIUR8nTwJGWwovp hM4EvSPbecIQLb56EvEI55W4RUwTFyvMywJ/Ks3YVoA2mfbr4j5FnmiaWtZ5Zvmrm6dm DyRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tgz0YVDS; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si2905564pga.1.2018.04.12.14.53.41; Thu, 12 Apr 2018 14:53:54 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=tgz0YVDS; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752981AbeDLU7f (ORCPT + 99 others); Thu, 12 Apr 2018 16:59:35 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:38602 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbeDLU7d (ORCPT ); Thu, 12 Apr 2018 16:59:33 -0400 Received: by mail-ua0-f195.google.com with SMTP id q38so4437121uad.5; Thu, 12 Apr 2018 13:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EMsk8lrTQSZfUeipbnCRp5jfEaYCHZDQTlL2aq2cX0k=; b=tgz0YVDSM8Lbm5IcJtrKeKYxnRNOb4x3qvQRW6X6ILS9XxFG2yCKKYvsjISdsAklcV pTH1rZJzci/mi0zjXbue4R1fYmZMyaMEM9twWNhdXPU6UIUBnRmuib58PLNnr0mVfETK X/yJ460TusAZ3xXMJycJx38dxBvzdZJjmROxaoG/xSLPohIuXGPrlW5z17NaE6ZhZhWj wCWZxnUIsr6AcrVyzapUk+7P10H6bBBRM5UliZBp4q+GyheTd6bP983YL+5I/eMQkeJD AtNZCBg1Iwc0dOhcZBropA7YkavhZW4mPCFpRxG6UHDpyEj3pKDNqWaPfKWIRvz6jdy4 lsdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EMsk8lrTQSZfUeipbnCRp5jfEaYCHZDQTlL2aq2cX0k=; b=VFoFWYqj/DmN8Q5Mp+mkG9RR34AtXYEEW3MXPm4mNURMp6Ztcgi7iBTS6x4HZWmral E7gUHGNof3212epwGJuy0KNnwlwKZvUFzUbRngCO4Xv838AeiNlOTJbMJ5kll+Hye4zn GEzND31P4mu+vXRHZn1z6rxlaba9JD/Ww6HBsy72EFUBXM3CWBFJsodRDcefLiost8Ic zt5x7yahc68vqSh0KdVd/gwO5OINjNsEIMy7o1nVhVDP7jTJ7MsmNf3hJqUTkl+JhZFZ q7kiR5/M5agM8bStpc9KzJFXjemBspVfejj/L3K7KtJ0HwFo2aHdgcC+zcM2u3ZkLe2p yn9Q== X-Gm-Message-State: ALQs6tBDSXvzTEZJtPSWGGdbneKP2sMzIsYmJlQIQ/GA2gP5p7+/mB8m BJ+qt8bjilXqiacCWv/+cZdkYC/c+Fte19t5FsQ= X-Received: by 10.176.91.201 with SMTP id z9mr1922549uae.97.1523566773024; Thu, 12 Apr 2018 13:59:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.22.112 with HTTP; Thu, 12 Apr 2018 13:59:32 -0700 (PDT) In-Reply-To: <20180313132639.17387-8-willy@infradead.org> References: <20180313132639.17387-1-willy@infradead.org> <20180313132639.17387-8-willy@infradead.org> From: Ross Zwisler Date: Thu, 12 Apr 2018 14:59:32 -0600 Message-ID: Subject: Re: [PATCH v9 07/61] xarray: Add the xa_lock to the radix_tree_root To: Matthew Wilcox Cc: Andrew Morton , Matthew Wilcox , LKML , Linux MM , linux-fsdevel , Ryusuke Konishi , linux-nilfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 13, 2018 at 7:25 AM, Matthew Wilcox wrote= : > From: Matthew Wilcox > > This results in no change in structure size on 64-bit machines as it > fits in the padding between the gfp_t and the void *. 32-bit machines > will grow the structure from 8 to 12 bytes. Almost all radix trees > are protected with (at least) a spinlock, so as they are converted from > radix trees to xarrays, the data structures will shrink again. > > Initialising the spinlock requires a name for the benefit of lockdep, > so RADIX_TREE_INIT() now needs to know the name of the radix tree it's > initialising, and so do IDR_INIT() and IDA_INIT(). > > Also add the xa_lock() and xa_unlock() family of wrappers to make it > easier to use the lock. If we could rely on -fplan9-extensions in > the compiler, we could avoid all of this syntactic sugar, but that > wasn't added until gcc 4.6. > > Signed-off-by: Matthew Wilcox > Reviewed-by: Jeff Layton This is causing build breakage in the radix tree test suite in the current linux/master: 5d1365940a68 (linux/master) Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Here's the first breakage: cc -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=3Daddress -c -o idr.o idr.c In file included from ./linux/radix-tree.h:6:0, from ./linux/../../../../include/linux/idr.h:15, from ./linux/idr.h:1, from idr.c:4: ./linux/../../../../include/linux/idr.h: In function =E2=80=98idr_init_base= =E2=80=99: ./linux/../../../../include/linux/radix-tree.h:129:2: warning: implicit declaration of function =E2=80=98spin_lock_init=E2=80=99; did you = mean =E2=80=98spinlock_t=E2=80=99? [-Wimplicit-function-declaration] spin_lock_init(&(root)->xa_lock); \ ^ ./linux/../../../../include/linux/idr.h:126:2: note: in expansion of macro =E2=80=98INIT_RADIX_TREE=E2=80=99 INIT_RADIX_TREE(&idr->idr_rt, IDR_RT_MARKER); ^~~~~~~~~~~~~~~