Re: [PATCH] zram: fix possible race when checking idle_strm

Joonsoo Kim
2015-08-10T00:29:45Z

On Fri, Aug 07, 2015 at 11:49:04PM +0900, Minchan Kim wrote:
> Hi Joonsoo,
>
> On Fri, Aug 07, 2015 at 05:03:29PM +0900, Joonsoo Kim wrote:
> > Currently, when we enter the wait state due to lack of idle stream,
> > we check idle_strm list without holding the lock in expanding of
> > wait_event define. In this case, some one can see stale value and
> > process could fall into wait state without any upcoming wakeup process.
> > Although I didn't see any error related to this race, it should be fixed.
>
> Long time ago, I wondered about lost wake-up problem and found a article.
>
> http://www.linuxjournal.com/article/8144
>
> >From then, I have thought such issue shouldn't happen if something is
> wrong since then and I believe it's same issue.
>
> Could you point out exact code sequence about the problem you mentioned?

Hello,

I describe exact code sequence in reply of Sergey's mail.
It would fully describe the problem.

Thanks.