Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2017 at 05:20:11PM +0800, Yafang Shao wrote: > Hi Peter, > > 2017-08-01 17:12 GMT+08:00 Peter Zijlstra : > > On Tue, Aug 01, 2017 at 04:57:43PM +0800, Yafang Shao wrote: > >> > And how would that happen? We only call pick_next_entity(.curr=NULL) > >> > when we _know_ cfs_rq->nr_run

Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Yafang Shao
Hi Peter, 2017-08-01 17:12 GMT+08:00 Peter Zijlstra : > On Tue, Aug 01, 2017 at 04:57:43PM +0800, Yafang Shao wrote: >> > And how would that happen? We only call pick_next_entity(.curr=NULL) >> > when we _know_ cfs_rq->nr_running. >> >> It crashed my machine when I did hadoop test, and after I mad

Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2017 at 04:57:43PM +0800, Yafang Shao wrote: > > And how would that happen? We only call pick_next_entity(.curr=NULL) > > when we _know_ cfs_rq->nr_running. > > It crashed my machine when I did hadoop test, and after I made this change > it works now. > On SMP system, cfs_rq->nr_ru

Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Yafang Shao
Hi Peter, Thanks for your response! > CFS, CFQ is a block IO scheduler. Sorry for the mistake. It should be CFS. > And how would that happen? We only call pick_next_entity(.curr=NULL) > when we _know_ cfs_rq->nr_running. It crashed my machine when I did hadoop test, and after I made this chang

Re: [PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-08-01 Thread Peter Zijlstra
On Tue, Aug 01, 2017 at 06:01:56PM +0800, Yafang Shao wrote: > When we select CFQ as the scheduler, in function pick_next_task_fair CFS, CFQ is a block IO scheduler. > it will pass NULL as the 2nd argument to pick_next_entity: > pick_next_entity(cfs_rq, NULL); > > And once __pick_first_entit

[PATCH] sched: fix NULL pointer issue in pick_next_entity()

2017-07-31 Thread Yafang Shao
When we select CFQ as the scheduler, in function pick_next_task_fair it will pass NULL as the 2nd argument to pick_next_entity: pick_next_entity(cfs_rq, NULL); And once __pick_first_entity() is called, it could return NULL as well. So in function pick_next_entity(), the local variable 'left'