[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 4/9] mm: Scrub memory from idle loop

On 05/12/2017 04:17 AM, Dario Faggioli wrote:
> On Thu, 2017-05-11 at 13:05 -0400, Boris Ostrovsky wrote:
>> On 05/11/2017 11:48 AM, Dario Faggioli wrote:
>>> It probably would be at least a bit better, if scrub_free_pages()
>>> would
>>> check for softirqs() _before_ starting any scrubbing (which I don't
>>> think it does, right now, am I right?).
>> Right.
>> I didn't realize that do_tasklet() also schedules softirq. So you are
>> suggesting something along the lines of
>>         do_tasklet();
>>         if ( !softirq_pending(smp_processor_id() &&
>> !scrub_free_pages() )
>>             (*pm_idle)();
>>         do_softirq();
> I was indeed suggesting something like that, and in fact I was about to
> say that, yes, what you wrote above should work.
> *But* (and sorry for overlooking that), if there is more than one
> tasklet queued SCHEDULE_SOFTIRQ is not raised (look at the 'if
> (list_empty())' in do_tasklet()), and hence the softirq_pending() check
> would fail, and we'll still try to scrub.
> Basically, we'd have some scrubbing happening in between the processing
> of two tasklets (and this will repeat, as a pattern, if there are more
> than two), and unless someone else raises an (unrelated) softirq at
> some point, we may even scrub a significant amount of memory.
> So, it looks to me that the gating should consider both,
> softirq_pending() and tasklet_work_to_do (making it look really really
> similar to cpu_is_haltable()...).

So I will then just use cpu_is_haltable() --- the possibly unnecessary
cpu_online() check here is simple/quick enough to justify reusing
existing macro.


Attachment: signature.asc
Description: OpenPGP digital signature

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.