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] [day] [month] [year] [list]
Message-Id: <20081204135441.dc95ffc7.kamezawa.hiroyu@jp.fujitsu.com>
Date:	Thu, 4 Dec 2008 13:54:41 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	"wassim dagash" <wassim.dagash@...il.com>,
	linux-kernel@...r.kernel.org,
	"kosaki.motohiro@...fujitsu.com" <kosaki.motohiro@...fujitsu.com>
Subject: Re: KSWAPD Algorithm

On Wed, 03 Dec 2008 15:51:11 +0100
Andi Kleen <andi@...stfloor.org> wrote:

> "wassim dagash" <wassim.dagash@...il.com> writes:
> 
> > Hi All,
> > Description:
> > I countered a weird problem with kswapd:
> > it runs in some infinite loop trying to swap until order 10 of zone
> > highmem is OK, While zone higmem (as I understand) has nothing to do
> > with contiguous physical memory (cause there is no 1-1 mapping) which
> > means kswapd will continue to try to balance order 10 of zone highmem
> > forever (or until someone release a very large chunk of highmem).
> > Can anyone please explain me the algorithm of kswapd and why it tries
> > to balance order 10 of zone higmem ?
> 
> hugetlbfs requires large continuous mappings even in highmem
> to map 2MB pages or similar to user space.
> However order 10 seems pretty high, normally that's only order 8
> on a i386 system.
> 

Reading Kosaki's explanation, it seems

  - order-10 allocation occurs at ZONE_NORMAL.

  - kswapd is kicked with order=10.
	wakeup_kswaps(zone, 10) -> pgdat->kswapd_max_order = 10.
  
  - kswapd(balance_pgdat()) does 
	if (!zone_watermark_ok(zone, order, zone->pages_high, end_zone, 0))
			all_zones_ok = 0;
    And this "zone" is all zone, i.e. DMA, NORMAL, HIGHMEM.

    Then, loop again,

	if (!all_zones_ok) {
		cond_resched();

		try_to_freeze();

		goto loop_again;
	}

Maybe...

-Kame

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