mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miquel van Smoorenburg <miquels@cistron.nl>
To: Kevin Corry <kevcorry@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.4-rc1-mm1: queue-congestion-dm-implementation patch
Date: Tue, 2 Mar 2004 14:01:39 +0100	[thread overview]
Message-ID: <20040302130137.GA9941@cistron.nl> (raw)
In-Reply-To: <200403011400.51008.kevcorry@us.ibm.com>

According to Kevin Corry:
> Article: 452202 of lists.linux.kernel
> From: Kevin Corry <kevcorry@us.ibm.com>
> Date:	Mon, 1 Mar 2004 14:00:50 -0600
> Newsgroups: lists.linux.kernel
> Approved: news@news.cistron.nl
> 
> The queue-congestion-dm-implementation patch in 2.6.4-rc1-mm1 (included below) 
> allows a DM device to query the lower-level device(s) during the 
> queue-congestion APIs. However, it must wait on an internal semaphore 
> (md->lock) before passing the call down to the lower-level devices. The 
> problem is that the higher-level caller is holding a spinlock at the same 
> time. Here is one such stack-trace I have been seeing:
> 
> Debug: sleeping function called from invalid context at include/linux/
> rwsem.h:43
> in_atomic():1, irqs_disabled():0
> Call Trace:
>  [<c012456b>] __might_sleep+0xab/0xd0
>  [<c03a0771>] dm_any_congested+0x21/0x60

Is there any way to reproduce this? I turned on spinlock and
sleep-spinlock debugging and did lots of I/O but I don't see it.

> I'm not sure how to fix this (or how serious a problem it is)...I'm just 
> throwing this out there for discussion.

Well bdi_write_congested() is racy, ofcourse, so in theory a call
to make_request() could be made which can block (and for dm, locks
the same semaphore) - so this can happen anyway. Only the chance of
it is much lower. I'm not sure how bad it is.

Changing down_read() in dm_any_congested to down_read_trylock() would
probably fix it for bdi_*_congested(). If you can tell me how to
reproduce it I can try a few things..

Mike.

  reply	other threads:[~2004-03-02 13:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cistron.200403011400.51008.kevcorry@us.ibm.com>
2004-03-01 20:00 ` Kevin Corry
2004-03-02 13:01   ` Miquel van Smoorenburg [this message]
2004-03-02 14:26     ` Kevin Corry
2004-03-02 22:21       ` Andrew Morton
2004-03-03  0:15         ` Miquel van Smoorenburg

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=20040302130137.GA9941@cistron.nl \
    --to=miquels@cistron.nl \
    --cc=kevcorry@us.ibm.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®