public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/5] xfs: use per-filesystem I/O completion workqueues
       [not found]       ` <20111110174242.GZ20464@sgi.com>
@ 2011-11-14 10:34         ` Christoph Hellwig
  2011-11-14 18:13           ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2011-11-14 10:34 UTC (permalink / raw)
  To: Ben Myers, Tejun Heo; +Cc: xfs, linux-kernel

On Thu, Nov 10, 2011 at 11:42:42AM -0600, Ben Myers wrote:
> > +STATIC int
> > +xfs_init_mount_workqueues(
> > +	struct xfs_mount	*mp)
> > +{
> > +#define XFS_WQ_NAME_LEN		512
> > +	char			name[XFS_WQ_NAME_LEN];
> > +
> > +	snprintf(name, XFS_WQ_NAME_LEN, "xfs-data/%s", mp->m_fsname);
> > +	mp->m_data_workqueue = alloc_workqueue(name, WQ_MEM_RECLAIM, 1);
> > +	if (!mp->m_data_workqueue)
> > +		goto out;
> 
> Looks to me like alloc_workqueue holds on to that name pointer in
> wq->name... won't overwriting the name below be a problem?

It applies deep magic to make sure a pattern like mine is fine for
the lockdep lock name, but just uses it directly for the workqueue name.

Oddly enough the names seem to display correctly on my test systems
anyway.

Tejun, any chance to change alloc_workqueue to use the string pasting
trick also for the normal workqueue name, or even better add a varargs
version of alloc_workqueue?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/5] xfs: use per-filesystem I/O completion workqueues
  2011-11-14 10:34         ` [PATCH 2/5] xfs: use per-filesystem I/O completion workqueues Christoph Hellwig
@ 2011-11-14 18:13           ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2011-11-14 18:13 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Ben Myers, xfs, linux-kernel

Hello, Christoph.

On Mon, Nov 14, 2011 at 05:34:10AM -0500, Christoph Hellwig wrote:
> On Thu, Nov 10, 2011 at 11:42:42AM -0600, Ben Myers wrote:
> > > +STATIC int
> > > +xfs_init_mount_workqueues(
> > > +	struct xfs_mount	*mp)
> > > +{
> > > +#define XFS_WQ_NAME_LEN		512
> > > +	char			name[XFS_WQ_NAME_LEN];
> > > +
> > > +	snprintf(name, XFS_WQ_NAME_LEN, "xfs-data/%s", mp->m_fsname);
> > > +	mp->m_data_workqueue = alloc_workqueue(name, WQ_MEM_RECLAIM, 1);
> > > +	if (!mp->m_data_workqueue)
> > > +		goto out;
> > 
> > Looks to me like alloc_workqueue holds on to that name pointer in
> > wq->name... won't overwriting the name below be a problem?
> 
> It applies deep magic to make sure a pattern like mine is fine for
> the lockdep lock name, but just uses it directly for the workqueue name.

For lockdep lock name, it isn't about reusing but ensuring that same
lockdep key doesn't end up with different names which lockdep doesn't
allow.  But yeah, given that workqueue is dynamically allocated, it's
a bit silly to require the name to be constant.

> Oddly enough the names seem to display correctly on my test systems
> anyway.
> 
> Tejun, any chance to change alloc_workqueue to use the string pasting
> trick also for the normal workqueue name, or even better add a varargs
> version of alloc_workqueue?

Yeah, will whip something up.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-14 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20111108085614.478431403@bombadil.infradead.org>
     [not found] ` <20111108085846.291838677@bombadil.infradead.org>
     [not found]   ` <20111108231118.GP5534@dastard>
     [not found]     ` <20111109075847.GA20604@infradead.org>
     [not found]       ` <20111110174242.GZ20464@sgi.com>
2011-11-14 10:34         ` [PATCH 2/5] xfs: use per-filesystem I/O completion workqueues Christoph Hellwig
2011-11-14 18:13           ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox