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] [day] [month] [year] [list]
Date:	Tue, 24 Mar 2009 11:18:47 +0100
From:	Jens Axboe <jens.axboe@...cle.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Jerome Marchand <jmarchan@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: forbid to re-enable I/O stat accounting

On Sat, Mar 21 2009, Andrew Morton wrote:
> 
> Please fix your email headers - what I received was
> 
> From: Jerome Marchand <jmarchan@...hat.com>
> To: unlisted-recipients:;;@imap1.linux-foundation.org (no To-header on input)
> Cc: Jens Axboe <axboe@...nel.dk>
> 
> 
> On Thu, 19 Mar 2009 11:36:50 +0100 Jerome Marchand <jmarchan@...hat.com> wrote:
> 
> > When we stop I/O stat accounting we stop to update the in-flight
> > requests counter and we need this counter to be reliable for
> > accounting I/O stats. Unfortunately updating in_flight field may
> > affect performance. So, until we have a better solution, just forbid
> > to re-enable I/O stat accounting after it has been disabled.
> 
> hm.  Is it really so hard to just quiesce the device until all in-flight
> requests have drained?  freeze_bdev() might be a suitable starting point?

freeze_bdev() is too far up, I think. It would be better to just reuse
the quiscing code we use for switching io schedulers on-the-fly.
Basically something ala:

        spin_lock_irq(q->queue_lock);
        queue_flag_set(QUEUE_FLAG_ELVSWITCH, q);
        elv_drain_elevator(q);
        while (q->rq.elvpriv) {
                blk_start_queueing(q);
                spin_unlock_irq(q->queue_lock);
                msleep(10);
                spin_lock_irq(q->queue_lock);
                elv_drain_elevator(q);
        }

        re-enable IO accounting;
        spin_unlock_irq(q->queue_lock);

and then don't account requests that don't have REQ_ELVPRIV set. I think
that should be acceptable. I was pretty sure I had a patch for something
else that yanked this logic into start/stop helpers... Ah, found it:

http://git.kernel.dk/?p=linux-2.6-block.git;a=commitdiff;h=8cb9f793b82024cd43ed5d4583a5287d002abdf8

-- 
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