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]
Date:	Wed, 7 Dec 2011 02:13:13 +0800
From:	zhihua che <zhihua.che@...il.com>
To:	Michal Hocko <mhocko@...e.cz>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [Page Allocator] when is init_per_zone_wmark_min called to first
 initialize the watermarks, reserved memory etc?

2011/12/6 Michal Hocko <mhocko@...e.cz>:
> On Tue 06-12-11 03:25:29, zhihua che wrote:
>> 2011/12/6 zhihua che <zhihua.che@...il.com>:
>> > Hi, everyone
>> >
>> >        I'm reading the linux kernel codes, and now focusing on memory
>> > management. I came across a simple problem:).
>> >        I know the every zone keeps three water marks to control the
>> > allocator's behavior and I find the three watermarks is initialized in
>> > init_per_zone_wmark_min.
>> > Unfortunately, I can't find when this function is called FIRSTduring
>> > the kernel booting process. I searched the source codes using LXR and
>> > cscope and got nothing.
>> > I guess I missed something but I have no any idea.
>> >
>> > harvey.
>>
>>
>> Maybe I'm closer the truth:-)
>> I find this function is defined as a module entry function (I should'v
>> found this earlier). As far as I know module entry functions are
>> called at the end of start_kernel() by rest_init(), whereas page
>> allocator / buddy system is used before they are called. For example,
>> __get_free_pages() is called in kmem_cache_init() which in turn is
>> called in start_kernel() earlier than rest_init().
>
> Yes, this is correct. We do live without watermarks (resp. with 0) for
> some time and we rely that we have sufficient memory for that time (who
> we would reclaim from when no processes exist - apart from init and few
> kernel threads).
> kswapd is started around the same time.
>
> HTH
> --

Thanks for your tips. I think it helps.
--
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