Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp187543ybl; Wed, 21 Aug 2019 17:19:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsxS+pu4M9mln8u6rju4i60lTM6m/kMi4rq/PtjxMb+ZbLCzjq0Bxb2qmcYlqY322VJRa0 X-Received: by 2002:a17:902:e512:: with SMTP id ck18mr34644546plb.53.1566433159397; Wed, 21 Aug 2019 17:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566433159; cv=none; d=google.com; s=arc-20160816; b=nwqwrmNZohJsiDWPzZl+GQCXGkL2Ef311JGaPEs3rAYRXdPAetieHz59ZKAmf8YcIH isBBDqtbr30kcxMUFmgtunc+xS/6vGKxuGY4+8sW3/mjHNjxLYmqjA/3Cd3EkVQMmDLq A2QRMjqwfyoyiz5WPaPLd0sTXoSFpk/E4WkzemyS7+s3uB3/VI9MvNTDQqVcwbgIMTrM 1vwkCmliu5NFt38FyOP1DtOEt3kGl2YYTRHyXoxHqec8eotYB6OTtyJb8zGb5g2C0egu +3jqJOZ03+MTQPeNF08tseUTPWoTrkEihLI+OlS0/OUJ/iULmnHm3jukVau9UtAG0aJ8 NCbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ulFbNzA9b5vRVN6/SZzhpTQBctv6NDxyo6JV6dAYMZI=; b=JDBVRE9UUf7Wl3e/miIR/Cl1ARaS4HOPlsoyFN14LW8hgG58MwSdpmfFafEcsKVcqz jR7+TLX4hNJ497dETKetGYnOSMfp80PmtfqclQeK8fJhvhrKQiM/3lz4rednPFF58fgS Dert1KEZZc+RodWdY5poMuz4f3vBjInQkCbnisK6S28n3dJYedf9OFS3YCd98oKAppDK nPjQ6Yi4Tli5Cti2nvdswft9Pmt6EsFsFS6T9l4JU2qbWt6tUCRw7RYxXkBpLUmZnh9p BuBPHyJdXVteoSLoiL6j7vxL7rV9oycMFCq7DJQIuisK9isAmwdMYhvG3Qw8ShkTy73Q qCOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=arq4xCxe; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si15733576pgc.305.2019.08.21.17.19.03; Wed, 21 Aug 2019 17:19:19 -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=@google.com header.s=20161025 header.b=arq4xCxe; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728497AbfHVAR1 (ORCPT + 99 others); Wed, 21 Aug 2019 20:17:27 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:38583 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727484AbfHVAR0 (ORCPT ); Wed, 21 Aug 2019 20:17:26 -0400 Received: by mail-yw1-f66.google.com with SMTP id f187so1681672ywa.5 for ; Wed, 21 Aug 2019 17:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ulFbNzA9b5vRVN6/SZzhpTQBctv6NDxyo6JV6dAYMZI=; b=arq4xCxeNbVzw1mj9oaCKvl7JTiIF99/NsrNSN+AnMEyM0a/Xfg9vhQv0BvOqpWpe/ v3tA64zDckl5lhF90Woh7EfD80UCUDCUEkwHgJdQ+pgFlUTEMuywha9octggJ/sq9T5Y BW0hphWaaZLycOGI8NXBkBcqchnfncBPqVisO4hct/IOUJeJzhUN+rFzeKfW8Pz+ppmK PFAFiA/jizlGE0vBh8SKextDcb6FTDqYsYmTawuXiPYSyxmEOMOlGVhwsUcKMPM2e4/A DQA9FatJIVjx3ZWptpeZUDKwSqY/MY/d2t3JV0ySCIdBuqC1sXmOflg4USbr6TCSBC8P m/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ulFbNzA9b5vRVN6/SZzhpTQBctv6NDxyo6JV6dAYMZI=; b=TFmZIyU7ygcdVzJBQ54CHoi54DZZmAbDF4dlbd4bsspZE4Qz7Sdue6B4hsLJ8v3bbM wEBJIyA7Byg2vu6NlxyWoSdfDxWPvmZLJ1E4K2IB0x0oKCbtGQ3Jj3Pw71y1eFOq3O07 xFHw2xN7naMkPp1Ppe1ng5aFAkAasF4ZF0/tzzf07VIcMsU/MkPTyOFxJSlC/MBWo1dx LsxlFxXWjflHUPg+ZDF4mjhMrTsiY8qQNttTVC2b5f09xhiZl4+8KGY2bFVZ+N4vBk+D yyQqrScD5xs1st6prpvmHcMJ9ggfLbvz8XHiRTLbY1eMHp2yCz1WKZyugh1myYxuSHnI ZEoA== X-Gm-Message-State: APjAAAVhQMjv+45pPHxRILi/stMLL9Hbb6vdmdhxL+tA45p90WVG0YcO bzHVegeISBVr9Uuu5WsflXrrmhS5UuxgnpOwyKrqvaVDGA8= X-Received: by 2002:a81:a448:: with SMTP id b69mr25417748ywh.4.1566433045475; Wed, 21 Aug 2019 17:17:25 -0700 (PDT) MIME-Version: 1.0 References: <20190822000933.180870-1-khazhy@google.com> In-Reply-To: <20190822000933.180870-1-khazhy@google.com> From: Shakeel Butt Date: Wed, 21 Aug 2019 17:17:14 -0700 Message-ID: Subject: Re: [PATCH 1/3] fuse: on 64-bit store time in d_fsdata directly To: Khazhismel Kumykov Cc: miklos@szeredi.hu, linux-fsdevel , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 21, 2019 at 5:09 PM Khazhismel Kumykov wrote: > > Implements the optimization noted in f75fdf22b0a8 ("fuse: don't use > ->d_time"), as the additional memory can be significant. (In particular, > on SLAB configurations this 8-byte alloc becomes 32 bytes). Per-dentry, > this can consume significant memory. > > Signed-off-by: Khazhismel Kumykov Actually we are seeing this in production where a job creating a lot of fuse files cause a lot of extra system level overhead. Reviewed-by: Shakeel Butt > --- > fs/fuse/dir.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c > index dd0f64f7bc06..f9c59a296568 100644 > --- a/fs/fuse/dir.c > +++ b/fs/fuse/dir.c > @@ -24,6 +24,18 @@ static void fuse_advise_use_readdirplus(struct inode *dir) > set_bit(FUSE_I_ADVISE_RDPLUS, &fi->state); > } > > +#if BITS_PER_LONG >= 64 > +static inline void fuse_dentry_settime(struct dentry *entry, u64 time) > +{ > + entry->d_fsdata = (void *) time; > +} > + > +static inline u64 fuse_dentry_time(struct dentry *entry) > +{ > + return (u64)entry->d_fsdata; > +} > + > +#else > union fuse_dentry { > u64 time; > struct rcu_head rcu; > @@ -38,6 +50,7 @@ static inline u64 fuse_dentry_time(struct dentry *entry) > { > return ((union fuse_dentry *) entry->d_fsdata)->time; > } > +#endif > > /* > * FUSE caches dentries and attributes with separate timeout. The > @@ -242,6 +255,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags) > goto out; > } > > +#if BITS_PER_LONG < 64 > static int fuse_dentry_init(struct dentry *dentry) > { > dentry->d_fsdata = kzalloc(sizeof(union fuse_dentry), GFP_KERNEL); > @@ -254,16 +268,21 @@ static void fuse_dentry_release(struct dentry *dentry) > > kfree_rcu(fd, rcu); > } > +#endif > > const struct dentry_operations fuse_dentry_operations = { > .d_revalidate = fuse_dentry_revalidate, > +#if BITS_PER_LONG < 64 > .d_init = fuse_dentry_init, > .d_release = fuse_dentry_release, > +#endif > }; > > const struct dentry_operations fuse_root_dentry_operations = { > +#if BITS_PER_LONG < 64 > .d_init = fuse_dentry_init, > .d_release = fuse_dentry_release, > +#endif > }; > > int fuse_valid_type(int m) > -- > 2.23.0.187.g17f5b7556c-goog >