public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ifdef blktrace debugging fields
       [not found]     ` <20060801074436.GJ31908@suse.de>
@ 2006-08-01 13:47       ` Alexey Dobriyan
  2006-08-01 20:12         ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2006-08-01 13:47 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Andrew Morton, linux-kernel

On Tue, Aug 01, 2006 at 09:44:36AM +0200, Jens Axboe wrote:
> Certainly. If Alexey adds the blkdev.h bit as well, we can go ahead with
> it.

Done. Originally I looked at slab size of task_struct and still
recovering.

[PATCH] ifdef blktrace debugging fields

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 block/ll_rw_blk.c      |    4 ++--
 include/linux/blkdev.h |    4 ++--
 include/linux/sched.h  |    3 ++-
 kernel/fork.c          |    2 ++
 4 files changed, 8 insertions(+), 5 deletions(-)

--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1779,10 +1779,10 @@ static void blk_release_queue(struct kob
 
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	if (q->blk_trace)
 		blk_trace_shutdown(q);
-
+#endif
 	kmem_cache_free(requestq_cachep, q);
 }
 
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -417,9 +417,9 @@ struct request_queue
 	unsigned int		sg_timeout;
 	unsigned int		sg_reserved_size;
 	int			node;
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	struct blk_trace	*blk_trace;
-
+#endif
 	/*
 	 * reserved for flush operations
 	 */
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -784,8 +784,9 @@ #endif
 	struct prio_array *array;
 
 	unsigned short ioprio;
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	unsigned int btrace_seq;
-
+#endif
 	unsigned long sleep_avg;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -177,7 +177,9 @@ static struct task_struct *dup_task_stru
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->fs_excl, 0);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	tsk->btrace_seq = 0;
+#endif
 	tsk->splice_pipe = NULL;
 	return tsk;
 }


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

* Re: [PATCH] ifdef blktrace debugging fields
  2006-08-01 13:47       ` [PATCH] ifdef blktrace debugging fields Alexey Dobriyan
@ 2006-08-01 20:12         ` Jens Axboe
  2006-08-01 22:49           ` [PATCH v3] " Alexey Dobriyan
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2006-08-01 20:12 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Andrew Morton, linux-kernel

On Tue, Aug 01 2006, Alexey Dobriyan wrote:
> On Tue, Aug 01, 2006 at 09:44:36AM +0200, Jens Axboe wrote:
> > Certainly. If Alexey adds the blkdev.h bit as well, we can go ahead with
> > it.
> 
> Done. Originally I looked at slab size of task_struct and still
> recovering.

;-)

> [PATCH] ifdef blktrace debugging fields
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  block/ll_rw_blk.c      |    4 ++--
>  include/linux/blkdev.h |    4 ++--
>  include/linux/sched.h  |    3 ++-
>  kernel/fork.c          |    2 ++
>  4 files changed, 8 insertions(+), 5 deletions(-)
> 
> --- a/block/ll_rw_blk.c
> +++ b/block/ll_rw_blk.c
> @@ -1779,10 +1779,10 @@ static void blk_release_queue(struct kob
>  
>  	if (q->queue_tags)
>  		__blk_queue_free_tags(q);
> -
> +#ifdef CONFIG_BLK_DEV_IO_TRACE
>  	if (q->blk_trace)
>  		blk_trace_shutdown(q);
> -
> +#endif
>  	kmem_cache_free(requestq_cachep, q);
>  }

That can be made ifdef less, if you unconditionally call
blk_trace_shutdown() and just make that one do:

        if (q->blk_trace) {
                ...
        }

since that'll then do the right always. Please make that change, then
I'm fine with the patch.

-- 
Jens Axboe


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

* [PATCH v3] ifdef blktrace debugging fields
  2006-08-01 20:12         ` Jens Axboe
@ 2006-08-01 22:49           ` Alexey Dobriyan
  2006-08-02  5:18             ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2006-08-01 22:49 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Andrew Morton, linux-kernel

On Tue, Aug 01, 2006 at 10:12:57PM +0200, Jens Axboe wrote:
> > +#ifdef CONFIG_BLK_DEV_IO_TRACE
> >  	if (q->blk_trace)
> >  		blk_trace_shutdown(q);
> > -
> > +#endif
> >  	kmem_cache_free(requestq_cachep, q);
> >  }
>
> That can be made ifdef less, if you unconditionally call
> blk_trace_shutdown() and just make that one do:
>
>         if (q->blk_trace) {
>                 ...
>         }
>
> since that'll then do the right always. Please make that change, then
> I'm fine with the patch.

OK here goes version 3.

[PATCH] ifdef blktrace debugging fields

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 block/blktrace.c       |    6 ++++--
 block/ll_rw_blk.c      |    3 +--
 include/linux/blkdev.h |    4 ++--
 include/linux/sched.h  |    3 ++-
 kernel/fork.c          |    2 ++
 5 files changed, 11 insertions(+), 7 deletions(-)

--- a/block/blktrace.c
+++ b/block/blktrace.c
@@ -450,8 +450,10 @@ int blk_trace_ioctl(struct block_device
  **/
 void blk_trace_shutdown(request_queue_t *q)
 {
-	blk_trace_startstop(q, 0);
-	blk_trace_remove(q);
+	if (q->blk_trace) {
+		blk_trace_startstop(q, 0);
+		blk_trace_remove(q);
+	}
 }
 
 /*
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1780,8 +1780,7 @@ static void blk_release_queue(struct kob
 	if (q->queue_tags)
 		__blk_queue_free_tags(q);
 
-	if (q->blk_trace)
-		blk_trace_shutdown(q);
+	blk_trace_shutdown(q);
 
 	kmem_cache_free(requestq_cachep, q);
 }
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -417,9 +417,9 @@ struct request_queue
 	unsigned int		sg_timeout;
 	unsigned int		sg_reserved_size;
 	int			node;
-
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	struct blk_trace	*blk_trace;
-
+#endif
 	/*
 	 * reserved for flush operations
 	 */
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -784,8 +784,9 @@ #endif
 	struct prio_array *array;
 
 	unsigned short ioprio;
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	unsigned int btrace_seq;
-
+#endif
 	unsigned long sleep_avg;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -177,7 +177,9 @@ static struct task_struct *dup_task_stru
 	/* One for us, one for whoever does the "release_task()" (usually parent) */
 	atomic_set(&tsk->usage,2);
 	atomic_set(&tsk->fs_excl, 0);
+#ifdef CONFIG_BLK_DEV_IO_TRACE
 	tsk->btrace_seq = 0;
+#endif
 	tsk->splice_pipe = NULL;
 	return tsk;
 }


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

* Re: [PATCH v3] ifdef blktrace debugging fields
  2006-08-01 22:49           ` [PATCH v3] " Alexey Dobriyan
@ 2006-08-02  5:18             ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2006-08-02  5:18 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Andrew Morton, linux-kernel

On Wed, Aug 02 2006, Alexey Dobriyan wrote:
> On Tue, Aug 01, 2006 at 10:12:57PM +0200, Jens Axboe wrote:
> > > +#ifdef CONFIG_BLK_DEV_IO_TRACE
> > >  	if (q->blk_trace)
> > >  		blk_trace_shutdown(q);
> > > -
> > > +#endif
> > >  	kmem_cache_free(requestq_cachep, q);
> > >  }
> >
> > That can be made ifdef less, if you unconditionally call
> > blk_trace_shutdown() and just make that one do:
> >
> >         if (q->blk_trace) {
> >                 ...
> >         }
> >
> > since that'll then do the right always. Please make that change, then
> > I'm fine with the patch.
> 
> OK here goes version 3.
> 
> [PATCH] ifdef blktrace debugging fields

Looks good!

Acked-by: Jens Axboe <axboe@suse.de>

-- 
Jens Axboe


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

end of thread, other threads:[~2006-08-02  5:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200608010657.k716vBWF004420@shell0.pdx.osdl.net>
     [not found] ` <20060801071658.GG31908@suse.de>
     [not found]   ` <20060801002904.53407219.akpm@osdl.org>
     [not found]     ` <20060801074436.GJ31908@suse.de>
2006-08-01 13:47       ` [PATCH] ifdef blktrace debugging fields Alexey Dobriyan
2006-08-01 20:12         ` Jens Axboe
2006-08-01 22:49           ` [PATCH v3] " Alexey Dobriyan
2006-08-02  5:18             ` Jens Axboe

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