mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brent Casavant <bcasavan@sgi.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@osdl.org>, Christoph Rohland <cr@sap.com>,
	Robin Holt <holt@sgi.com>, "Adam J. Richter" <adam@yggdrasil.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] shmem: restore superblock info
Date: Mon, 6 Jun 2005 15:18:57 -0500 (CDT)	[thread overview]
Message-ID: <20050606150742.F19925@chenjesu.americas.sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0506062043470.5000@goblin.wat.veritas.com>

On Mon, 6 Jun 2005, Hugh Dickins wrote:

> @@ -1607,15 +1582,17 @@ static int shmem_statfs(struct super_blo
>  	buf->f_type = TMPFS_MAGIC;
>  	buf->f_bsize = PAGE_CACHE_SIZE;
>  	buf->f_namelen = NAME_MAX;
> -	if (sbinfo) {
> -		spin_lock(&sbinfo->stat_lock);
> +	spin_lock(&sbinfo->stat_lock);
> +	if (sbinfo->max_blocks) {
>  		buf->f_blocks = sbinfo->max_blocks;
>  		buf->f_bavail = buf->f_bfree = sbinfo->free_blocks;
> +	}
> +	if (sbinfo->max_inodes) {
>  		buf->f_files = sbinfo->max_inodes;
>  		buf->f_ffree = sbinfo->free_inodes;
> -		spin_unlock(&sbinfo->stat_lock);
>  	}
>  	/* else leave those fields 0 like simple_statfs */
> +	spin_unlock(&sbinfo->stat_lock);
>  	return 0;
>  }

This is the only change I'm at all concerned about.

I'm not sure how frequent statfs operations occur in practice (I suspect
infrequently), however simply changing the existing code from "if (sbinfo)"
to "if (sbinfo->max_blocks || sbinfo->max_inodes)" would be an appropriate
remedy if there is a real problem.

That said, I'm not all that concerned about it, as my fuzzy memory
indicates it was the lock/unlock around the statistics updates which
caused the primary lock contention.

Brent

-- 
Brent Casavant                          If you had nothing to fear,
bcasavan@sgi.com                        how then could you be brave?
Silicon Graphics, Inc.                    -- Queen Dama, Source Wars

  reply	other threads:[~2005-06-06 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-06 19:46 Hugh Dickins
2005-06-06 20:18 ` Brent Casavant [this message]
2005-06-06 20:30   ` Hugh Dickins
2005-06-06 20:36     ` Brent Casavant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050606150742.F19925@chenjesu.americas.sgi.com \
    --to=bcasavan@sgi.com \
    --cc=adam@yggdrasil.com \
    --cc=akpm@osdl.org \
    --cc=cr@sap.com \
    --cc=holt@sgi.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®