On 03/29/2017 at 03:51 PM, Dave Young wrote:
On 03/29/17 at 03:26pm, Xunlei Pang wrote:
> On 03/29/2017 at 03:10 PM, Dave Young wrote:
>> Hi Xunlei,
>>
>> On 03/29/17 at 02:38pm, Xunlei Pang wrote:
>>> We replace "reserved_memory= 8192" with "reserved_memory =
1024"
>>> in /etc/lvm/lvm.conf used by "lvm2", this can save 7MB peak memory
>>> consumption, so we lower the possibility of kdump OOM.
>>>
>>> For kdump, we don't have too many lvm targets, lvm2 locates in the
>>> RAM(rootfs), so don't need that much memory, as discussed with lvm
>>> people, they agree that we can use 1MB under kdump as long as there
>>> are not so many lvm targets invloved.
>>>
>>> We modify /etc/lvm/lvm.conf when "99kdumpbase" install() is
executed,
>>> because it is parsed after "90lvm" by dracut.
>>>
>>> Signed-off-by: Xunlei Pang <xlpang(a)redhat.com>
>>> ---
>>> dracut-module-setup.sh | 5 +++++
>>> 1 file changed, 5 insertions(+)
>>>
>>> diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
>>> index 1f96bb8..674f3ee 100755
>>> --- a/dracut-module-setup.sh
>>> +++ b/dracut-module-setup.sh
>>> @@ -743,4 +743,9 @@ install() {
>>> # target. Ideally all this should be pushed into dracut iscsi module
>>> # at some point of time.
>>> kdump_check_iscsi_targets
>>> +
>>> + # For the lvm type target under kdump, in /etc/lvm/lvm.conf we can
safely replace
>>> + # "reserved_memory = 8192" with "reserved_memory =
1024" to lower memory pressure
>> The code is setting reserved_memory = 1024 unconditionally, not only for
>> relacing 8192 with 1024, need update the commit to match the code. Also
>> the line is too long as well.
> It only does replacing actually, but if lvm.conf doesn't exist, the code actually
does nothing.
Yes, I got that, what I means is if someone set it as
reserved_memory=4096 we still set it to 1024, so the comment just say
8192 -> 1024. We can just say we will unconditionally set it as 1024.
Indeed, will update soon.
Regards,
Xunlei