lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Oct 2008 10:52:50 +0200
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Elias Oltmanns <eo@...ensachen.de>
Cc:	Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] ide: use queue lock instead of ide_lock when possible

On Fri, Oct 10 2008, Elias Oltmanns wrote:
> Bartlomiej Zolnierkiewicz <bzolnier@...il.com> wrote:
> > From: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> > Subject: [PATCH] ide: use queue lock instead of ide_lock when possible
> >
> > This is just a preparation for future changes and there should be no
> > functional changes caused by this patch since ide_lock is currently
> > also used as queue lock.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>
> > ---
> [...]
> > Index: b/drivers/ide/ide-io.c
> > ===================================================================
> > --- a/drivers/ide/ide-io.c
> > +++ b/drivers/ide/ide-io.c
> [...]
> > @@ -1469,16 +1470,16 @@ out:
> >  void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
> >  {
> >  	ide_hwgroup_t *hwgroup = drive->hwif->hwgroup;
> > +	struct request_queue *q = drive->queue;
> >  	unsigned long flags;
> >  
> >  	hwgroup->rq = NULL;
> >  
> > -	spin_lock_irqsave(&ide_lock, flags);
> > -	__elv_add_request(drive->queue, rq, ELEVATOR_INSERT_FRONT, 1);
> > -	__generic_unplug_device(drive->queue);
> > -	spin_unlock_irqrestore(&ide_lock, flags);
> > +	spin_lock_irqsave(q->queue_lock, flags);
> > +	__elv_add_request(q, rq, ELEVATOR_INSERT_FRONT, 1);
> > +	__generic_unplug_device(q);
> 
> By the way, wouldn't blk_run_queue() be more appropriate here? It looks
> to me as if blk_run_queue() was the thing intended for general usage by
> low level drivers who don't know and care about schedulers, whereas the
> usage of __generic_unplug_device() should mostly be restricted to the
> block layer. On the other hand, there are other drivers in
> drivers/block/ that use __generic_unplug_device(), so I may well be
> wrong. Jens?

Yes, that is correct. But it's ok for now, there are too many variants
of this around as it is already. I'm about to do a run and clean them up
and make sure we have a single sane way of doing it that is exported.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ