Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp133670pxf; Wed, 17 Mar 2021 00:59:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiiNdw/1PLIcYSbZ7xDVFqgFmVxl8aKTUInRhKDdkb4g3rgt825TBXb85b8NGYYDBW4itC X-Received: by 2002:aa7:c4d1:: with SMTP id p17mr40844951edr.387.1615967969855; Wed, 17 Mar 2021 00:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615967969; cv=none; d=google.com; s=arc-20160816; b=0ihtM8cy6tu76vuGz48zdLBQJBdnFXslnP5tR1CY7LeC1EdTuBlqyDW3qAov/d7Yw4 vu7Rh0Mcu0xkFDzZwvDV3Od29pIeGci9aVwGx/0uzD2hyfIXPrVZxGN4/XVlvlTC3QpT Cq+8kNSspnA1LMCnZqCfcYu7xyPD+D0bp0ciMUKWA300SnVWMvC1T5g2A7R4/2RZD5yj WQaEnU2hEL+MYs6fHj0TL71XeSwW+gEYvdtN0DnLluxn2iGzH9YdCUR5LgMHvIY7we1S vq4JaD7UqiM4hC6K8bU4muTM09pGjAL8xAUaDUIckHZkwfUL/0xrNZ0rH9cZnOEpTImL mzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=ziBsbyS3lm6nf7flQdqQWeBZQuqAgL7zzxeHaCRJiHI=; b=ad9wW1hBQ4xmxo4YdqSMGIJZycsynGhiSnkhH6jsQh4W4+Ad629NFvbinYCyNJCr+q QA25LeADhgMsSsU4qB+QYn/8kEPiWD0OZm1VbkAEcBuRSnsL/3TAcmwpSqBwCdAfWBdT z6iFAu7+QoXO/XxlClVjTDzWs/2kcphEDklpE/PrBYKDxKNDLs6CoJjTCMsFThmuP2LB fnsHHo2agvw85///lBJ1SRKYYrK0OgLDT9LMprSM6Tvojz0JkcS6+JbK1ROIvaz5Ys1X OL7uR5Fv+V8LCVqTxtMs1ElEbZZanCVvc/aBh+bAiTaKcVNhEYu8NsOnwjvbOWlkoFP5 JVyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si15745690edy.80.2021.03.17.00.59.07; Wed, 17 Mar 2021 00:59:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230458AbhCQHzf (ORCPT + 99 others); Wed, 17 Mar 2021 03:55:35 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:47337 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230112AbhCQHzB (ORCPT ); Wed, 17 Mar 2021 03:55:01 -0400 Received: from mail-oo1-f42.google.com ([209.85.161.42]) by mrelayeu.kundenserver.de (mreue010 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MEmMt-1lTGeG2Qn5-00GEn4 for ; Wed, 17 Mar 2021 08:54:59 +0100 Received: by mail-oo1-f42.google.com with SMTP id n12-20020a4ad12c0000b02901b63e7bc1b4so342161oor.5 for ; Wed, 17 Mar 2021 00:54:59 -0700 (PDT) X-Gm-Message-State: AOAM532+DucYiBdWiglc/4NY4Mve3PFJemp4LJ+SB5zV0kcJBzszkfAL beITd6GlTKpdF7YODNueX/dOKdzClxmSXfJ3dFw= X-Received: by 2002:a4a:e9a2:: with SMTP id t2mr2259266ood.15.1615967698408; Wed, 17 Mar 2021 00:54:58 -0700 (PDT) MIME-Version: 1.0 References: <1615966419-20549-1-git-send-email-jiapeng.chong@linux.alibaba.com> In-Reply-To: <1615966419-20549-1-git-send-email-jiapeng.chong@linux.alibaba.com> From: Arnd Bergmann Date: Wed, 17 Mar 2021 08:54:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] sched: replace if (cond) BUG() with WARN_ON() To: Jiapeng Chong Cc: Jeremy Kerr , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:WbvoJvkq4gTEpqyzcJuch8EuoqB5Oa5f/Lh805kHeZ0T+D9x1Mk raoJxf8GgG7f0doND+RomVG1hdqkWahpQUF4BCfsyE7i35Fp8+Qkz3vPugyxOS41Jq+2U8E R7M2S+q1rlpv2SusOacJs64oS+VoZYTT9WmucUxcxPdZYR/BADBR2byIxAQrsRltIvw5NTH VzVy+4mz5yZ0EwiomRsgA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:4rQ/fZbXcnI=:+VnbZpoX532ymUdm5WBHvK J08VEsQeXrOj1WFadhi62I+8xizG3EznDYtrlfl6HzM4mSfhSzyngUqXzKWJBsc5oSMobQhp1 s7oOHH1dYQUsfEJ9M6jMD9+/FdW/gFlxYFC8SmQk1KFIwJzpTV8Hvk5dCyVGPH2kdqr4qpeHH bjNeA1WLcYiu3jkV0+lAlr+pwN4VlTmZBiZMTgrWHlhXlbq6+B2olUR8AQIiDJ4ZRx4z9dI8S vPi+Jqp+nyzymY27eS7YUDdbczxYeI3BQF/P75TU3HyBTJ3OYRUN29syaIAUn08534hJTQFlj zJsqgFgAacZNV06nSOYnDEsWOpSQ5iMZSMvKxtcbq9g+o0ZXFifZVkEwkYF2NTga4ApT6H9qz 3YV6UU21O00yx2/M1hJzvTVOY49KYXkaZkQ5+TEJ9rY+nvKUdVPmcK3960TaL Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 8:35 AM Jiapeng Chong wrote: > > Fix the following coccicheck warnings: > > ./arch/powerpc/platforms/cell/spufs/sched.c:908:2-5: WARNING: Use BUG_ON > instead of if condition followed by BUG. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong If you change it from BUG() to WARN_ON(), you should explain why it's safe to do that in this case. Here it is not, since the following spu_release() will end up making things worse if the acquire failed. Also if there was a signal pending, then spusched_tick() will just get called again and constantly print these warnings. There is probably a way to use WARN_ON_ONCE() here, in combination with a way to terminate the thread safely, but this has to be done carefully. Arnd