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]
Message-Id: <20081107104224.1631057e.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Fri, 7 Nov 2008 10:42:24 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Mel Gorman <mel@....ul.ie>
Cc:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-mm <linux-mm@...ck.org>
Subject: Re: [RFC][PATCH] mm: the page of MIGRATE_RESERVE don't insert into
 pcp

On Thu, 6 Nov 2008 16:46:45 +0000
Mel Gorman <mel@....ul.ie> wrote:
> > otherwise, the system have unnecessary memory starvation risk
> > because other cpu can't use this emergency pages.
> > 
> > 
> > 
> > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
> > CC: Mel Gorman <mel@....ul.ie>
> > CC: Christoph Lameter <cl@...ux-foundation.org>
> > 
> 
> This patch seems functionally sound but as Christoph points out, this
> adds another branch to the fast path. Now, I ran some tests and those that
> completed didn't show any problems but adding branches in the fast path can
> eventually lead to hard-to-detect performance problems.
> 
dividing pcp-list into MIGRATE_TYPES is bad ?
If divided, we can get rid of scan. 

Thanks,
-Kame



> Do you have a situation in mind that this patch fixes up?
> 
> Thanks
> 
> > ---
> >  mm/page_alloc.c |   12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > Index: b/mm/page_alloc.c
> > ===================================================================
> > --- a/mm/page_alloc.c	2008-11-06 06:01:15.000000000 +0900
> > +++ b/mm/page_alloc.c	2008-11-06 06:27:41.000000000 +0900
> > @@ -1002,6 +1002,7 @@ static void free_hot_cold_page(struct pa
> >  	struct zone *zone = page_zone(page);
> >  	struct per_cpu_pages *pcp;
> >  	unsigned long flags;
> > +	int migratetype = get_pageblock_migratetype(page);
> >  
> >  	if (PageAnon(page))
> >  		page->mapping = NULL;
> > @@ -1018,16 +1019,25 @@ static void free_hot_cold_page(struct pa
> >  	pcp = &zone_pcp(zone, get_cpu())->pcp;
> >  	local_irq_save(flags);
> >  	__count_vm_event(PGFREE);
> > +
> > +	set_page_private(page, migratetype);
> > +
> > +	/* the page for emergency shouldn't be cached */
> > +	if (migratetype == MIGRATE_RESERVE) {
> > +		free_one_page(zone, page, 0);
> > +		goto out;
> > +	}
> >  	if (cold)
> >  		list_add_tail(&page->lru, &pcp->list);
> >  	else
> >  		list_add(&page->lru, &pcp->list);
> > -	set_page_private(page, get_pageblock_migratetype(page));
> >  	pcp->count++;
> >  	if (pcp->count >= pcp->high) {
> >  		free_pages_bulk(zone, pcp->batch, &pcp->list, 0);
> >  		pcp->count -= pcp->batch;
> >  	}
> > +
> > +out:
> >  	local_irq_restore(flags);
> >  	put_cpu();
> >  }
> > 
> > 
> 
> -- 
> Mel Gorman
> Part-time Phd Student                          Linux Technology Center
> University of Limerick                         IBM Dublin Software Lab
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
> 

--
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