lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 10 Jun 2008 17:03:48 -0400
From:	Rik van Riel <riel@...hat.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, lee.schermerhorn@...com,
	kosaki.motohiro@...fujitsu.com
Subject: Re: [PATCH -mm 16/25] SHM_LOCKED pages are non-reclaimable

On Fri, 6 Jun 2008 18:05:14 -0700
Andrew Morton <akpm@...ux-foundation.org> wrote:

> > While working with Nick Piggin's mlock patches,
> 
> Change log refers to information which its reader has not got a hope
> of actually locating.

Fixed that, and renamed everything to "unevictable".

> > Use the AS_NORECLAIM flag to mark address_space of SHM_LOCKed
> > shared memory regions as non-reclaimable.  Then these pages
> > will be culled off the normal LRU lists during vmscan.
> 
> So I guess there's more justification for handling these pages in this
> manner, because someone could come along later and unlock them.  But
> that isn't true of /dev/ram0 pages and ramfs pages, etc.

Bingo.  Ramdisk and ramfs pages will never become evictable again,
while the pages in an SHM_LOCKED segment might.
 
> > +static void check_move_noreclaim_page(struct page *page, struct zone *zone)
> > +{
> > +
> > +	ClearPageNoreclaim(page); /* for page_reclaimable() */
> 
> Confused.  Didn't we just lose track of our NR_NORECLAIM accounting?
> 
> > +	if (page_reclaimable(page, NULL)) {
> > +		enum lru_list l = LRU_INACTIVE_ANON + page_file_cache(page);
> > +		__dec_zone_state(zone, NR_NORECLAIM);

No, we decrement the zone count here if the page is indeed
unevictable.

> > +		list_move(&page->lru, &zone->list[l]);
> > +		__inc_zone_state(zone, NR_INACTIVE_ANON + l);
> > +	} else {
> > +		/*
> > +		 * rotate noreclaim list
> > +		 */
> > +		SetPageNoreclaim(page);
> > +		list_move(&page->lru, &zone->list[LRU_NORECLAIM]);
> > +	}
> > +}

Or mark it unevictable again if it still is.

> > + * scan_mapping_noreclaim_pages - scan an address space for reclaimable pages
> > + * @mapping: struct address_space to scan for reclaimable pages
> > + *
> > + * Scan all pages in mapping.  Check non-reclaimable pages for
> > + * reclaimability and move them to the appropriate zone lru list.
> > + */
> > +void scan_mapping_noreclaim_pages(struct address_space *mapping)
> > +{

> This function can spend fantastically large amounts of time under
> spin_lock_irq().

I'll leave it up to Lee and Kosaki-san to fix this, once
you have the cleaned up versions.

Fixing this now would just delay my other janitorial work on
this patch series...

-- 
All Rights Reversed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ