The patch titled Subject: checkpatch: reduce is_maintained_obsolete lookup runtime has been added to the -mm tree. Its filename is checkpatch-reduce-is_maintained_obsolete-lookup-runtime.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-reduce-is_maintained_obsolete-lookup-runtime.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-reduce-is_maintained_obsolete-lookup-runtime.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: checkpatch: reduce is_maintained_obsolete lookup runtime The is_maintained_obsolete function can be called twice using the same filename. This function spawns a process using get_maintainer.pl. Store the status of each filename when spawned and use the stored result to eliminate the spawning of unnecessary duplicate child processes. Example: old: $ time ./scripts/checkpatch.pl hp100-Move-to-staging.patch > /dev/null real 0m1.767s user 0m1.634s sys 0m0.141s new: $ time ./scripts/checkpatch.pl hp100-Move-to-staging.patch > /dev/null real 0m1.184s user 0m1.085s sys 0m0.103s Link: http://lkml.kernel.org/r/b982566a2b9b4825badce36fdfc3032bd0005151.camel@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/scripts/checkpatch.pl~checkpatch-reduce-is_maintained_obsolete-lookup-runtime +++ a/scripts/checkpatch.pl @@ -888,14 +888,18 @@ sub seed_camelcase_file { } } +our %maintained_status = (); + sub is_maintained_obsolete { my ($filename) = @_; return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl")); - my $status = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`; + if (!exists($maintained_status{$filename})) { + $maintained_status{$filename} = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`; + } - return $status =~ /obsolete/i; + return $maintained_status{$filename} =~ /obsolete/i; } sub is_SPDX_License_valid { _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are kernel-sysc-avoid-copying-possible-padding-bytes-in-copy_to_user.patch get_maintainer-add-signatures-from-fixes-badcommit-lines-in-commit-message.patch string-add-stracpy-and-stracpy_pad-mechanisms.patch checkpatch-improve-ignoring-camelcase-si-style-variants-like-ma.patch checkpatch-reduce-is_maintained_obsolete-lookup-runtime.patch