Re: [PATCH 2/2] ras: close the race condition with timer

2019-04-16 Thread Cong Wang
On Tue, Apr 16, 2019 at 11:00 AM Cong Wang wrote: > > As far as I understand, two works in the global workqueue could > be still ran in parallel on different CPU's, this is why I said it has to > be an ordered queue to guarantee the serialization. Never mind, I think we both agree to hold the mut

Re: [PATCH 2/2] ras: close the race condition with timer

2019-04-16 Thread Cong Wang
On Tue, Apr 16, 2019 at 10:43 AM Borislav Petkov wrote: > > On Tue, Apr 16, 2019 at 10:09:49AM -0700, Cong Wang wrote: > > They are just locks requiring different contexts, I don't see how one is > > simpler than the other. Do you mind to be more specific? > > Yes, I'd like for this whole CEC code

Re: [PATCH 2/2] ras: close the race condition with timer

2019-04-16 Thread Borislav Petkov
On Tue, Apr 16, 2019 at 10:09:49AM -0700, Cong Wang wrote: > They are just locks requiring different contexts, I don't see how one is > simpler than the other. Do you mind to be more specific? Yes, I'd like for this whole CEC code to be lazy and preemptible as it is not at all important when it do

Re: [PATCH 2/2] ras: close the race condition with timer

2019-04-16 Thread Cong Wang
On Tue, Apr 16, 2019 at 2:58 AM Borislav Petkov wrote: > > On Mon, Apr 15, 2019 at 06:20:01PM -0700, Cong Wang wrote: > > cec_timer_fn() is a timer callback which reads ce_arr.array[] > > and updates its decay values. Elements could be added to or > > removed from this global array in parallel, al

Re: [PATCH 2/2] ras: close the race condition with timer

2019-04-16 Thread Borislav Petkov
On Mon, Apr 15, 2019 at 06:20:01PM -0700, Cong Wang wrote: > cec_timer_fn() is a timer callback which reads ce_arr.array[] > and updates its decay values. Elements could be added to or > removed from this global array in parallel, although the array > itself will not grow or shrink. del_lru_elem_un

[PATCH 2/2] ras: close the race condition with timer

2019-04-15 Thread Cong Wang
cec_timer_fn() is a timer callback which reads ce_arr.array[] and updates its decay values. Elements could be added to or removed from this global array in parallel, although the array itself will not grow or shrink. del_lru_elem_unlocked() uses FULL_COUNT() as a key to find a right element to remo