Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1315621pxu; Thu, 17 Dec 2020 07:17:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7CkLOyE3oCg85qI8LcTteBQdOEctIJcuPVgalXP375FVzGb1YHZ079rEu7c8hYMCsIhpM X-Received: by 2002:a17:906:b307:: with SMTP id n7mr34973152ejz.102.1608218220388; Thu, 17 Dec 2020 07:17:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608218220; cv=none; d=google.com; s=arc-20160816; b=kARC+MSYqbQXMlWqRPo9vdUVTq6zZXhcZsxOhE3r728x9iaivGadf6gyacF8/VoGj0 Rdq11SD0Ij3ttUkShfYiQcGK/OfLij/Nemwzf05hhkyJqXKNdJ88zQdLCKy8fF9dKkVG qu39wbWTQuTe0hmnALyzOUm4SI1iJz98Dal8g/ez/nBAe3j3p4GaD0G8sW68sV0gpJNU LJ9pUhyCbQUABPuJYPQRlUZE9RVKxve4KGAA4TVCawxhq/YDoW2J/gYmb2UXx6aYQlmf YZpAsaa/KnG05BKX9jkaGPLND6JghPP1RywhIK147ZEcYEsBch+S9bbjwtw7ZDWmKjT2 Nf+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=YutvZo+Sqq4bs2edgHCuJ/pn2rMAD01S5REOBc6/o+I=; b=LifzHZu8qrfTWey0xSDSGvGE+FnD8nrfeFQ5IgxcyTIPZv36KP8b6kYiUd5OTDpOrr ARxasX0k7cOkWd4XsrpgS0bs+TIsA6do6zRy+f7cNPX1AEch0qVg4AvkpYexEoXzxBmD ZAwGPPIiG4M7vzJWUTIVTstnJujWm9rR+05JSJnaGy/wsRy4DwbF+1oPZC93tBbEfp80 wAVOYh7bbWZ/HJb8WCBnqxJ6bsGE1gHvgOpNjDQ1NOT8r7beTWGOFAEgav6j1263xzMP rA/ZeDo5tCOaSYDYDGwDK6SJJb82JNLqQErfiGoDo80/FzgsOhKKZ/L2+ldDVsg8HSlZ ZX3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WpzeRVE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh18si2813814ejb.374.2020.12.17.07.16.32; Thu, 17 Dec 2020 07:17:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WpzeRVE8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbgLQPP3 (ORCPT + 99 others); Thu, 17 Dec 2020 10:15:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727660AbgLQPP1 (ORCPT ); Thu, 17 Dec 2020 10:15:27 -0500 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C9D2C0617A7; Thu, 17 Dec 2020 07:14:47 -0800 (PST) Received: by mail-qk1-x72f.google.com with SMTP id p14so17504810qke.6; Thu, 17 Dec 2020 07:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YutvZo+Sqq4bs2edgHCuJ/pn2rMAD01S5REOBc6/o+I=; b=WpzeRVE8GeNTmyAeUx+h8k/UAYGJcXK7iXQWcFf/4Z9Hb3OjtynqgZ4vRI1uzidkgi LS6jdGRi7YAZ69Bmeuaf+Yhpkw16M/zM5h/vaVw0slBlqRPIuTMyeFzGUmU6dYFDN+Dg Xsj+cFRmyHHDNFn7Ti9LP9cU3Czd8i1hL00qXjh8dSZPPRh8/AnUbAK3iHFW+HvwfxlI k1sVJOjSjitJqAApbZLIiFBVo2EXaz3OR32bv7n9Wo45faU25HMe7fCpB6m7M7iTKOhA T3H122EXNAYP3Yelnga0X1AXT1YLFJqefGbLS+fS7j7+6fkV3j/dHI8JCD5PcPhlChds Y2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=YutvZo+Sqq4bs2edgHCuJ/pn2rMAD01S5REOBc6/o+I=; b=tze0CfA1SMrN2OzWzCxLsiMUjCsNHUNT7swiIBUH0liwyx/DcVWSI+yDa9S6ylL3El V0iK9Eu+MZQZhOlhhV8yuNF6G0rWHjsBjUnog9cqCcVHpoEVjyQRNJBO/JDldLzEIAou lQHcwfQQQbw9dNvQ+fOcPXcQY6L+kdz1yGKhYFJyOQtZeJOcEQTeo1HADhM+kIsoGSUo 1FaTikJt1wJKJINC7DzjN4Zt7LwI0GtUQKFqKScrshBQfT/3zRVp5XAiWvf/EUiTKpub 6W5iA0Kogj/Fbxao2d+dPGUccZ4+PjzC1jF3bxOPcP9fZPyqvvc4ZBkPr8yovrgAq68P YA/g== X-Gm-Message-State: AOAM5338W9wzKvhebXpVISVWujPvzxShcUafhqjJwLt7Xr+Y9vSNH08Y w+QDW7MGK6ZM+Yoa0BHG5Hk= X-Received: by 2002:a05:620a:406:: with SMTP id 6mr30366893qkp.494.1608218086697; Thu, 17 Dec 2020 07:14:46 -0800 (PST) Received: from localhost (dhcp-6c-ae-f6-dc-d8-61.cpe.echoes.net. [72.28.8.195]) by smtp.gmail.com with ESMTPSA id j203sm3538634qke.134.2020.12.17.07.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 07:14:45 -0800 (PST) Sender: Tejun Heo Date: Thu, 17 Dec 2020 10:14:13 -0500 From: Tejun Heo To: Ian Kent Cc: Fox Chen , Greg KH , akpm@linux-foundation.org, dhowells@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, miklos@szeredi.hu, ricklind@linux.vnet.ibm.com, sfr@canb.auug.org.au, viro@zeniv.linux.org.uk Subject: Re: [PATCH v2 0/6] kernfs: proposed locking and concurrency improvement Message-ID: References: <3e97846b52a46759c414bff855e49b07f0d908fc.camel@themaw.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Dec 17, 2020 at 07:48:49PM +0800, Ian Kent wrote: > > What could be done is to make the kernfs node attr_mutex > > a pointer and dynamically allocate it but even that is too > > costly a size addition to the kernfs node structure as > > Tejun has said. > > I guess the question to ask is, is there really a need to > call kernfs_refresh_inode() from functions that are usually > reading/checking functions. > > Would it be sufficient to refresh the inode in the write/set > operations in (if there's any) places where things like > setattr_copy() is not already called? > > Perhaps GKH or Tejun could comment on this? My memory is a bit hazy but invalidations on reads is how sysfs namespace is implemented, so I don't think there's an easy around that. The only thing I can think of is embedding the lock into attrs and doing xchg dance when attaching it. Thanks. -- tejun