On 05/03/2017 at 10:57 AM, Pratyush Anand wrote:
On Wednesday 03 May 2017 07:25 AM, Xunlei Pang wrote:
>>>> Since we already have methodology to cache requisite initrd information
now, so we can avoid copying whole logic from dracut now.
>>>> In the dracut code, we needed to traverse all the watchdog and find list
of all active watchdogs modules, while in kdump we can exit as early as a mismatch is
found. Yes, it would have been slower with lsinitrd, but now after lsinitrd gone, probably
existing logic would be simpler.
>>>>
>>>> We are adding 44 lines and deleting 22 lines. So, IMHO, If that does not
help in improving any performance gain then probably we can be happy with minimal
change(to read from cached lsinitrd) in existing code.
>>> One major reason is that I didn't find a neat way to collect previous
watchdog kernel module names(see "lsinitrd $TARGET_INITRD | grep $wdtdrv &>
/dev/null").
>>> Do you have any good idea?
>> I think this ["lsinitrd $TARGET_INITRD | grep $wdtdrv &>
/dev/null"] was unnecessarily complex even earlier. Following would have lighter,
no?
>> "lsinitrd -f etc/cmdline.d/00-watchdog.conf $TARGET_INITRD | grep $wdtdrv
&> /dev/null"
> Yes, read the code further, IMO the logic of the current implementation is more
complex than that of dracut 04watchdog.
>
> After removing the ".ko.xz" suffix $wdtdrv will be the module name, I would
rather use modprobe instead of modinfo.
>
> The the first half part of current implementation of check_wdt_modified() is similar
to the first half part of dracut 04watchdog,
> but still has a little difference:
> looks like the modprobe/modinfo may return multiple module names, we need to handle
them all like:
`modinfo -F filename` is special and lists the filename of the module. So, for any of the
alias it will point to real file name, which can be looked in 00-watchdog.conf. Therefore,
probably we can avoid the following loop.
I am afraid not, in case of <alias> mapped to multiple drivers, "modinfo -F
filename <alias>" will result in multiple filename lines, just like
"modprobe -R <alias>".
For example:
$ modinfo -F filename char-major-10-130
/lib/modules/3.10.0-636.el7.x86_64/kernel/drivers/watchdog/pcwd_pci.ko.xz
/lib/modules/3.10.0-636.el7.x86_64/kernel/drivers/watchdog/wdt_pci.ko.xz
/lib/modules/3.10.0-636.el7.x86_64/kernel/drivers/watchdog/pcwd_usb.ko.xz
/lib/modules/3.10.0-636.el7.x86_64/kernel/drivers/watchdog/alim1535_wdt.ko.xz
Regards,
Xunlei
>
> _wdtdrv=$(modprobe --set-version "$kdump_kver" -R $_wdtdrv
2>/dev/null)
> if [[ $_wdtdrv ]]; then
> for i in $_wdtdrv; do
> _drivers[$i]=1
> done
> fi
~Pratyush