Re: [PATCH 1/5] Swap Migration V5: LRU operations

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

 



Christoph Lameter <[email protected]> wrote:
>
>  +static void lru_add_drain_per_cpu(void *dummy)
>  +{
>  +	lru_add_drain();
>  +}
>  +
>  +/*
>  + * Isolate one page from the LRU lists and put it on the
>  + * indicated list. Do necessary cache draining if the
>  + * page is not on the LRU lists yet.
>  + *
>  + * Result:
>  + *  0 = page not on LRU list
>  + *  1 = page removed from LRU list and added to the specified list.
>  + * -1 = page is being freed elsewhere.
>  + */
>  +int isolate_lru_page(struct page *page)
>  +{
>  +	int rc = 0;
>  +	struct zone *zone = page_zone(page);
>  +
>  +redo:
>  +	spin_lock_irq(&zone->lru_lock);
>  +	rc = __isolate_lru_page(zone, page);
>  +	spin_unlock_irq(&zone->lru_lock);
>  +	if (rc == 0) {
>  +		/*
>  +		 * Maybe this page is still waiting for a cpu to drain it
>  +		 * from one of the lru lists?
>  +		 */
>  +		smp_call_function(&lru_add_drain_per_cpu, NULL, 0 , 1);

lru_add_drain() ends up doing spin_unlock_irq(), so we'll enable interrupts
within the smp_call_function() handler.  Is that legal on all
architectures?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux