mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Possible memory leak in block/ll_rw_blk.c
@ 2006-12-09 23:16 Catalin Marinas
  2006-12-13 10:00 ` Catalin Marinas
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2006-12-09 23:16 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Mike Christie

Hi,

After 2.6.19, kmemleak reports several (few tens) orphan blocks
allocated in bio_alloc_bioset() via __blk_rq_map_user() in
block/ll_rq_blk.c. I think these came with commit
0e75f9063f5c55fb0b0b546a7c356f8ec186825e (support larger block pc
requests). The allocation backtrace for the "bio" structure is:

unreferenced object 0xdd9162b0 (size 64):
  [<c018d46f>] kmem_cache_alloc
  [<c0170b2e>] mempool_alloc_slab
  [<c01709cb>] mempool_alloc
  [<c01b7baa>] bio_alloc_bioset
  [<c01b7d0e>] bio_alloc
  [<c01b83f8>] bio_copy_user
  [<c021a380>] __blk_rq_map_user
  [<c021a4ff>] blk_rq_map_user
  [<c021e687>] sg_io
  [<c021ed3e>] scsi_cmd_ioctl
  [<c02bcc13>] sd_ioctl
  [<c021ca65>] blkdev_driver_ioctl
  [<c021cc27>] blkdev_ioctl
  [<c01ba72b>] block_ioctl
  [<c019ea36>] do_ioctl

Because the above objects cannot be tracked, kmemleak also reports the
bio_map_data structures allocated in bio_alloc_map_data (called from
bio_copy_user via the above backtrace).

Thanks.

-- 
Catalin

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

* Re: Possible memory leak in block/ll_rw_blk.c
  2006-12-09 23:16 Possible memory leak in block/ll_rw_blk.c Catalin Marinas
@ 2006-12-13 10:00 ` Catalin Marinas
  2006-12-13 12:45   ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2006-12-13 10:00 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Mike Christie, FUJITA Tomonori

On 09/12/06, Catalin Marinas <catalin.marinas@gmail.com> wrote:
> unreferenced object 0xdd9162b0 (size 64):
>   [<c018d46f>] kmem_cache_alloc
>   [<c0170b2e>] mempool_alloc_slab
>   [<c01709cb>] mempool_alloc
>   [<c01b7baa>] bio_alloc_bioset
>   [<c01b7d0e>] bio_alloc
>   [<c01b83f8>] bio_copy_user
>   [<c021a380>] __blk_rq_map_user
>   [<c021a4ff>] blk_rq_map_user
>   [<c021e687>] sg_io
>   [<c021ed3e>] scsi_cmd_ioctl
>   [<c02bcc13>] sd_ioctl
>   [<c021ca65>] blkdev_driver_ioctl
>   [<c021cc27>] blkdev_ioctl
>   [<c01ba72b>] block_ioctl
>   [<c019ea36>] do_ioctl

I can confirm that the memory leak disappeared with commit
77d172ce2719b5ad2dc0637452c8871d9cba344c (by Fujita Tomonori).

Regards.

-- 
Catalin

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

* Re: Possible memory leak in block/ll_rw_blk.c
  2006-12-13 10:00 ` Catalin Marinas
@ 2006-12-13 12:45   ` FUJITA Tomonori
  0 siblings, 0 replies; 3+ messages in thread
From: FUJITA Tomonori @ 2006-12-13 12:45 UTC (permalink / raw)
  To: catalin.marinas; +Cc: linux-kernel, michaelc, fujita.tomonori

From: "Catalin Marinas" <catalin.marinas@gmail.com>
Subject: Re: Possible memory leak in block/ll_rw_blk.c
Date: Wed, 13 Dec 2006 10:00:05 +0000

> On 09/12/06, Catalin Marinas <catalin.marinas@gmail.com> wrote:
> > unreferenced object 0xdd9162b0 (size 64):
> >   [<c018d46f>] kmem_cache_alloc
> >   [<c0170b2e>] mempool_alloc_slab
> >   [<c01709cb>] mempool_alloc
> >   [<c01b7baa>] bio_alloc_bioset
> >   [<c01b7d0e>] bio_alloc
> >   [<c01b83f8>] bio_copy_user
> >   [<c021a380>] __blk_rq_map_user
> >   [<c021a4ff>] blk_rq_map_user
> >   [<c021e687>] sg_io
> >   [<c021ed3e>] scsi_cmd_ioctl
> >   [<c02bcc13>] sd_ioctl
> >   [<c021ca65>] blkdev_driver_ioctl
> >   [<c021cc27>] blkdev_ioctl
> >   [<c01ba72b>] block_ioctl
> >   [<c019ea36>] do_ioctl
> 
> I can confirm that the memory leak disappeared with commit
> 77d172ce2719b5ad2dc0637452c8871d9cba344c (by Fujita Tomonori).

Thanks. And sorry for introducing that bug.

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

end of thread, other threads:[~2006-12-13 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-09 23:16 Possible memory leak in block/ll_rw_blk.c Catalin Marinas
2006-12-13 10:00 ` Catalin Marinas
2006-12-13 12:45   ` FUJITA Tomonori

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®