From patchwork Sat Dec 2 15:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Levin, Alexander \(Sasha Levin\)" X-Patchwork-Id: 120423 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2499720qgn; Sat, 2 Dec 2017 08:12:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMYgTlKXjqWyByn2O5rNGbocQ5T3VXN4b7767Np6U3Z3wTnpySSjPGy2Xkiw/whykyxJPUIg X-Received: by 10.101.86.197 with SMTP id w5mr9281809pgs.190.1512231142495; Sat, 02 Dec 2017 08:12:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512231142; cv=none; d=google.com; s=arc-20160816; b=tGCQ8GXKAO9YClsuLc1eWUiSqriWSyX2ZmLCRQkj0oeX3fJH4Hj80Z5qd7E21IYjtv 3oZ3rPGakJ5eJQQaomSIR9gNJJnxOzdRBB775ia6kT1UhDMS8fa04ueMBPRVBbKVzF4M CNmzyVa0yOmKJiURnzWa2Fs4jkHFP0h3UMZa60/Cumd4dky4R95zrKgldSKnFpymgYM2 0TKr1W5vIIeE7bSq13g/woxHwUsEzdkDL47cY5wtcgqSElpiWIhbTO+QZlg6Iz8/fRJD FtOyKOfV347x8Qlvw1GXzzQV9h+J4VqqVTwrK+qNzup+e2JGwgClHqJEhHp6PcCMdXKh zdKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:cc:from:dkim-signature :dkim-signature:dkim-signature:arc-authentication-results; bh=MK4VUYC/Jf8s0NfpIh1oaWWgm5pL5FMH2vqO3RUXPb4=; b=RqszquIS5MPl5EvrSBIXLSlmsk6PdIiDBlbuSzG3NgdVSwL7fdSwmawyqHs76gftdc J/hDcW61BkSQtBvOcD6MPpP/MwHOwGBv7ivrD7x7DybzoCHL9PL/Wdy9w71yAr2cH9GT rXirRcrTSahdvCCt/SL/+TogHvq9QO7L5Wt+ZeSx49ZR4IFS/nIaasbX0Tg67XdAd5Rk mTYgIw890gft7mTQTFs06DXxF34OanQIj0rC2ZBVEK0Fcd0mY1ye1qe4ZU7FFpDpB85I yVBJuLdGcp9inpbwKHdqZ6EMtKBBcS3IAH9B62154QwMXDpEScxnFU+RbjMlvAjHf2il lr9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=rONluqgS; dkim=fail header.i=@verizon.com header.s=corp header.b=rChwS+pd; dkim=fail header.i=@verizon.com header.s=corp header.b=NU5+sMEB; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p21si7031337pfi.396.2017.12.02.08.12.22; Sat, 02 Dec 2017 08:12:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@verizon.com header.s=corp header.b=rONluqgS; dkim=fail header.i=@verizon.com header.s=corp header.b=rChwS+pd; dkim=fail header.i=@verizon.com header.s=corp header.b=NU5+sMEB; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=verizon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbdLBQMU (ORCPT + 9 others); Sat, 2 Dec 2017 11:12:20 -0500 Received: from fldsmtpe03.verizon.com ([140.108.26.142]:59457 "EHLO fldsmtpe03.verizon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbdLBPx3 (ORCPT ); Sat, 2 Dec 2017 10:53:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512230009; x=1543766009; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4J3pAQa+P3pnngaJAIfL79ADMbNp7vuy8sy/OoFMu3Y=; b=rONluqgSGYNddfb/fmpGCDQAaTPuEcRiXQ9ZlvcOkSkNJtuYTXzcgePN Ft13HHST3ntklgXcG4tyPohH8ra1GxhwtC0+3YOm9wZLd3TdK1qCzycch lggKVQ8HxKV5MulP4Vr1PB+a31cP6DupB3TJJF70GChw+PVCyDCXGcSHx g=; Received: from unknown (HELO fldsmtpi02.verizon.com) ([166.68.71.144]) by fldsmtpe03.verizon.com with ESMTP; 02 Dec 2017 15:53:21 +0000 Received: from rogue-10-255-192-101.rogue.vzwcorp.com (HELO atlantis.verizonwireless.com) ([10.255.192.101]) by fldsmtpi02.verizon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 15:53:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229995; x=1543765995; h=from:cc:to:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4J3pAQa+P3pnngaJAIfL79ADMbNp7vuy8sy/OoFMu3Y=; b=rChwS+pdP2N/M10XXDK2qtG3FZ2oDh2EFZGaOJsPI+1DJh+l9+A1jc10 0nkeugZxo3t0i9obZpohE0/NtuaPxwUNZCXLyMAvn/lUcGxAlVk9NjIn2 Uvza8iACtFgNw9okmVg1IQ9DyiMzIwLcT9pKT0lllGTp8x4K9iE3ObXv6 8=; Received: from mariner.tdc.vzwcorp.com (HELO eris.verizonwireless.com) ([10.254.88.84]) by atlantis.verizonwireless.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Dec 2017 10:53:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=verizon.com; i=@verizon.com; q=dns/txt; s=corp; t=1512229994; x=1543765994; h=to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version:from:cc; bh=4J3pAQa+P3pnngaJAIfL79ADMbNp7vuy8sy/OoFMu3Y=; b=NU5+sMEB3PY+YHewxI07lYwrIGGugsxoW79Zioqw3JeiMdoTkD9MAupc FbE0IM3RrdS0YhN2Ko7NYvWx6yhJ7LxeiNJVoVpZl67A3Qw/nVW4dtzP5 Sty8mqtbhHSPeV4HR43V2vb4lsumDcPMxXj/vFyVz/6LMULh+zthJP35J s=; From: alexander.levin@verizon.com Cc: Masahiro Yamada , alexander.levin@verizon.com X-Host: mariner.tdc.vzwcorp.com Received: from ohtwi1exh003.uswin.ad.vzwcorp.com ([10.144.218.45]) by eris.verizonwireless.com with ESMTP/TLS/AES128-SHA256; 02 Dec 2017 15:52:56 +0000 Received: from tbwexch26apd.uswin.ad.vzwcorp.com (153.114.162.50) by OHTWI1EXH003.uswin.ad.vzwcorp.com (10.144.218.45) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 2 Dec 2017 10:52:56 -0500 Received: from OMZP1LUMXCA20.uswin.ad.vzwcorp.com (144.8.22.198) by tbwexch26apd.uswin.ad.vzwcorp.com (153.114.162.50) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 10:52:55 -0500 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com (144.8.22.195) by OMZP1LUMXCA20.uswin.ad.vzwcorp.com (144.8.22.198) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Sat, 2 Dec 2017 09:52:55 -0600 Received: from OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) by OMZP1LUMXCA17.uswin.ad.vzwcorp.com ([144.8.22.195]) with mapi id 15.00.1263.000; Sat, 2 Dec 2017 09:52:55 -0600 To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: [PATCH AUTOSEL for 4.9 02/33] coccinelle: fix parallel build with CHECK=scripts/coccicheck Thread-Topic: [PATCH AUTOSEL for 4.9 02/33] coccinelle: fix parallel build with CHECK=scripts/coccicheck Thread-Index: AQHTa4WFFokPdNSQ/0WZFg9uCHSHvA== Date: Sat, 2 Dec 2017 15:52:13 +0000 Message-ID: <20171202155204.7691-2-alexander.levin@verizon.com> References: <20171202155204.7691-1-alexander.levin@verizon.com> In-Reply-To: <20171202155204.7691-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada [ 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 is given and 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 Acked-by: Julia Lawall Signed-off-by: Sasha Levin --- scripts/coccicheck | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.11.0 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