From: alexander.levin@verizon.com
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
alexander.levin@verizon.com
Subject: [PATCH AUTOSEL for 4.9 02/33] coccinelle: fix parallel build with CHECK=scripts/coccicheck
Date: Sat, 2 Dec 2017 15:52:13 +0000 [thread overview]
Message-ID: <20171202155204.7691-2-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171202155204.7691-1-alexander.levin@verizon.com>
From: Masahiro Yamada <yamada.masahiro@socionext.com>
[ Upstream commit d7059ca0147adcd495f3c5b41f260e1ac55bb679 ]
The command "make -j8 C=1 CHECK=scripts/coccicheck" produces
lots of "coccicheck failed" error messages.
Julia Lawall explained the Coccinelle behavior as follows:
"The problem on the Coccinelle side is that it uses a subdirectory
with the name of the semantic patch to store standard output and
standard error for the different threads. I didn't want to use a
name with the pid, so that one could easily find this information
while Coccinelle is running. Normally the subdirectory is cleaned
up when Coccinelle completes, so there is only one of them at a time.
Maybe it is best to just add the pid. There is the risk that these
subdirectories will accumulate if Coccinelle crashes in a way such
that they don't get cleaned up, but Coccinelle could print a warning
if it detects this case, rather than failing."
When scripts/coccicheck is used as CHECK tool and -j option is given
to Make, the whole of build process runs in parallel. So, multiple
processes try to get access to the same subdirectory.
I notice spatch creates the subdirectory only when it runs in parallel
(i.e. --jobs <N> is given and <N> is greater than 1).
Setting NPROC=1 is a reasonable solution; spatch does not create the
subdirectory. Besides, ONLINE=1 mode takes a single file input for
each spatch invocation, so there is no reason to parallelize it in
the first place.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
scripts/coccicheck | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/scripts/coccicheck b/scripts/coccicheck
index ec487b8e7051..c36b04b41686 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -29,12 +29,6 @@ else
VERBOSE=0
fi
-if [ -z "$J" ]; then
- NPROC=$(getconf _NPROCESSORS_ONLN)
-else
- NPROC="$J"
-fi
-
FLAGS="--very-quiet"
# You can use SPFLAGS to append extra arguments to coccicheck or override any
@@ -69,6 +63,9 @@ if [ "$C" = "1" -o "$C" = "2" ]; then
# Take only the last argument, which is the C file to test
shift $(( $# - 1 ))
OPTIONS="$COCCIINCLUDE $1"
+
+ # No need to parallelize Coccinelle since this mode takes one input file.
+ NPROC=1
else
ONLINE=0
if [ "$KBUILD_EXTMOD" = "" ] ; then
@@ -76,6 +73,12 @@ else
else
OPTIONS="--dir $KBUILD_EXTMOD $COCCIINCLUDE"
fi
+
+ if [ -z "$J" ]; then
+ NPROC=$(getconf _NPROCESSORS_ONLN)
+ else
+ NPROC="$J"
+ fi
fi
if [ "$KBUILD_EXTMOD" != "" ] ; then
--
2.11.0
next prev parent reply other threads:[~2017-12-02 16:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-02 15:52 [PATCH AUTOSEL for 4.9 01/33] kbuild: pkg: use --transform option to prefix paths in tar alexander.levin
2017-12-02 15:52 ` alexander.levin [this message]
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 03/33] net: qmi_wwan: add Quectel BG96 2c7c:0296 alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 04/33] x86/mpx/selftests: Fix up weird arrays alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 06/33] gre6: use log_ecn_error module parameter in ip6_tnl_rcv() alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 05/33] mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl() alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 08/33] route: update fnhe_expires for redirect when the fnhe exists alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 07/33] route: also update fnhe_genid when updating a route cache alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 09/33] drivers/rapidio/devices/rio_mport_cdev.c: fix resource leak in error handling path in 'rio_dma_transfer()' alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 11/33] dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0 alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 10/33] lib/genalloc.c: make the avail variable an atomic_long_t alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 14/33] xfs: fix forgotten rcu read unlock when skipping inode reclaim alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 13/33] sunrpc: Fix rpc_task_begin trace point alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 12/33] NFS: Fix a typo in nfs_rename() alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 17/33] sparc64/mm: set fields in deferred pages alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 16/33] block: wake up all tasks blocked in get_request() alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 15/33] dt-bindings: usb: fix reg-property port-number range alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 18/33] zsmalloc: calling zs_map_object() from irq is a bug alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 20/33] sctp: use the right sk after waking up from wait_buf sleep alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 19/33] sctp: do not free asoc when it is already dead in sctp_sendmsg alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 21/33] bpf: fix lockdep splat alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 23/33] atm: horizon: Fix irq release error alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 22/33] clk: uniphier: fix DAPLL2 clock rate of Pro5 alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 24/33] jump_label: Invoke jump_label_test() via early_initcall() alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 25/33] xfrm: Copy policy family in clone_policy alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 27/33] IB/mlx5: Assign send CQ and recv CQ of UMR QP alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 26/33] IB/mlx4: Increase maximal message size under UD QP alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 28/33] afs: Connect up the CB.ProbeUuid alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 29/33] kbuild: do not call cc-option before KBUILD_CFLAGS initialization alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 30/33] ipvlan: fix ipv6 outbound device alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 31/33] audit: ensure that 'audit=1' actually enables audit for PID 1 alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 32/33] md: free unused memory after bitmap resize alexander.levin
2017-12-02 15:52 ` [PATCH AUTOSEL for 4.9 33/33] RDMA/cxgb4: Annotate r2 and stag as __be32 alexander.levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171202155204.7691-2-alexander.levin@verizon.com \
--to=alexander.levin@verizon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®