mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Nikolay Borisov <n.borisov@siteground.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	axboe@kernel.dk, jack@suse.cz, linux-kernel@vger.kernel.org,
	cgroups@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/5] kernfs: implement kernfs_path_len()
Date: Thu, 9 Jul 2015 17:41:43 -0400	[thread overview]
Message-ID: <20150709214143.GD18734@mtj.duckdns.org> (raw)
In-Reply-To: <559CDA8B.6040909@siteground.com>

Hello, Nioklay.

I restored the cc list.  Please use reply-to-all.

On Wed, Jul 08, 2015 at 11:08:43AM +0300, Nikolay Borisov wrote:
> > +size_t kernfs_path_len(struct kernfs_node *kn)
> > +{
> > +	size_t len = 0;
> > +	unsigned long flags;
> > +
> > +	spin_lock_irqsave(&kernfs_rename_lock, flags);
> > +
> > +	do {
> > +		len += strlen(kn->name) + 1;
> > +		kn = kn->parent;
> > +	} while (kn && kn->parent);
> > +
> > +	spin_unlock_irqrestore(&kernfs_rename_lock, flags);
> > +
> > +	return len;
> > +}
> > +
> 
> Can you explain the reason why you need to disable the irqs while
> executing this function? Presumably it has to do with the context of its
> usage - tracepoints but I wasn't able to find any information about the
> implications of interrupts being enabled while in a trace point?

It doesn't have much to do with the specific usage.
kernfs_rename_lock is irq-safe because we want to be able to call
functions like kernfs_name() and kernfs_path() regardless of the
current context.

Thanks.

-- 
tejun

  parent reply	other threads:[~2015-07-09 21:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 15:10 [PATCHSET block/for-4.3] writeback: cgroup writeback updates Tejun Heo
2015-07-07 15:10 ` [PATCH 1/5] writeback: bdi_for_each_wb() iteration is memcg ID based not blkcg Tejun Heo
2015-07-07 15:10 ` [PATCH 2/5] writeback: remove wb_writeback_work->single_wait/done Tejun Heo
2015-07-07 15:10 ` [PATCH 3/5] writeback: explain why @inode is allowed to be NULL for inode_congested() Tejun Heo
2015-07-07 15:10 ` [PATCH 4/5] kernfs: implement kernfs_path_len() Tejun Heo
2015-07-07 15:12   ` Tejun Heo
2015-07-07 22:39     ` Greg Kroah-Hartman
     [not found]   ` <559CDA8B.6040909@siteground.com>
2015-07-09 21:41     ` Tejun Heo [this message]
2015-07-07 15:10 ` [PATCH 5/5] writeback: update writeback tracepoints to report cgroup Tejun Heo

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=20150709214143.GD18734@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jack@suse.cz \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=n.borisov@siteground.com \
    /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

Powered by JetHome