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
| ||
|
Date: Wed, 27 Feb 2013 12:16:55 -0500 From: Naoya Horiguchi <n-horiguchi@...jp.nec.com> To: gong.chen@...ux.intel.com Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, Mel Gorman <mel@....ul.ie>, Hugh Dickins <hughd@...gle.com>, KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>, Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org Subject: Re: [PATCH 8/9] memory-hotplug: enable memory hotplug to handle hugepage On Wed, Feb 27, 2013 at 02:36:04AM -0500, Chen Gong wrote: > On Thu, Feb 21, 2013 at 02:41:47PM -0500, Naoya Horiguchi wrote: ... > > @@ -3158,6 +3182,25 @@ static int is_hugepage_on_freelist(struct page *hpage) > > return 0; > > } > > > > +/* Returns true for head pages of in-use hugepages, otherwise returns false. */ > > +int is_hugepage_movable(struct page *hpage) > > +{ > > + struct page *page; > > + struct page *tmp; > > + struct hstate *h = page_hstate(hpage); > > + int ret = 0; > > + > > + VM_BUG_ON(!PageHuge(hpage)); > > + if (PageTail(hpage)) > > + return 0; > > + spin_lock(&hugetlb_lock); > > + list_for_each_entry_safe(page, tmp, &h->hugepage_activelist, lru) > > + if (page == hpage) > > + ret = 1; > > I don't understand the logic here. 1) page is not removed why tmp is used? > 2) why hitting (page ==hpage) but not breaking from the loop? For question 1), using list_for_each_entry_safe() was a remnant of try and error and will be fixed. And for question 2), I will add break in later version. Thanks, Naoya > > + spin_unlock(&hugetlb_lock); > > + return ret; > > +} > > + > > [...] -- 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