Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-27 Thread Johannes Thumshirn
On Wed, Sep 26, 2018 at 11:24:55AM -0700, Bart Van Assche wrote: > On Wed, 2018-09-26 at 17:06 +0200, Johannes Thumshirn wrote: > > On Wed, Sep 26, 2018 at 04:57:32PM +0200, Christoph Hellwig wrote: > > > I don't think this actually works given that rpm_status only exists > > > if CONFIG_PM is

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Bart Van Assche
On Wed, 2018-09-26 at 17:06 +0200, Johannes Thumshirn wrote: > On Wed, Sep 26, 2018 at 04:57:32PM +0200, Christoph Hellwig wrote: > > I don't think this actually works given that rpm_status only exists > > if CONFIG_PM is set. > > I think it'll work as GCC does constant propagation. There are >

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Johannes Thumshirn
On Wed, Sep 26, 2018 at 04:57:32PM +0200, Christoph Hellwig wrote: > I don't think this actually works given that rpm_status only exists > if CONFIG_PM is set. I think it'll work as GCC does constant propagation. There are actually some places in the kernel that follow this pattern.

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Christoph Hellwig
On Wed, Sep 26, 2018 at 04:43:57PM +0200, Johannes Thumshirn wrote: > > assert, so I guess we'll have to live with it.. > > How about: > if (IS_ENABLED(CONFIG_PM)) > WARN_ON_ONCE(q->rpm_status == RPM_SUSPENDED); I don't think this actually works

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Johannes Thumshirn
On Wed, Sep 26, 2018 at 04:27:40PM +0200, Christoph Hellwig wrote: > > list_for_each_entry(rq, >queue_head, queuelist) { > > - if (blk_pm_allow_request(rq)) > > - return rq; > > - > > - if (rq->rq_flags & RQF_SOFTBARRIER) >

Re: [PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-26 Thread Christoph Hellwig
> list_for_each_entry(rq, >queue_head, queuelist) { > - if (blk_pm_allow_request(rq)) > - return rq; > - > - if (rq->rq_flags & RQF_SOFTBARRIER) > - break; > +#ifdef CONFIG_PM > +

[PATCH v10 7/8] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-21 Thread Bart Van Assche
Instead of allowing requests that are not power management requests to enter the queue in runtime suspended status (RPM_SUSPENDED), make the blk_get_request() caller block. This change fixes a starvation issue: it is now guaranteed that power management requests will be executed no matter how many