Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp669133pxv; Thu, 1 Jul 2021 06:50:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYNIp5lR3kY2fZPGvPcJRLvuYVBrGg11jCbeMCFw5DQ5gyjauXtTnfPeKb49rudcLQ5CtW X-Received: by 2002:a17:906:f256:: with SMTP id gy22mr40646526ejb.103.1625147444678; Thu, 01 Jul 2021 06:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625147444; cv=none; d=google.com; s=arc-20160816; b=Ot9L+RrCdfHGd2vU4bpungYEr1syzHpDtiju69FAKb7bPqFy4qDG4hCpeZYgmDQjQw DJtube/H62THBrCEeOdQE2bCTZ23Gv6JeUr0e+1Txzy1ynJLThuRd8l3bOUn7h4OLbzy 2x6Zs01fXoxiGQEvc3NpovSz6XWH+gBDgqOjs0mKloKWbRygGYmD5C2HmPHb0pQhUpI5 tUYY/YsfHMlLDsiGWGqdUI5vIN5v/VabEyyeEhnuNo/YBBeYHgzmNquCr5KtDvaiJiQb u741KgpV2I5Mm+3jyMUuhrTfRqLhgu+EIWNrylugBVFrF4N7bEQJ+c05tNE0uVLflUde E2Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=erswH6xBiMTnUUks9AN2xhcWWsqi+J9rO/7T77OqAnY=; b=fD52ngSrMW5WLInnsy6bYPpLGpKNfdlHTwB2vUPa3ezUvZ3Mz+NqNJs5oW3gcvFCo8 jUu247vPtvih+zpdmN9Fuv+/gl0Zl6iQ6+3CSk0MNZk1Qif+WXcrnGeJ/xZUU1Tw4qFI nCUrG4fvTc8cPpRTZZiQnmSVSucPZ7hhAGb9BH2eaKiraC0luL8AYIeqgtbepQfBYW4E oP3y2BdFbc0CfmpO1Fu9DF6YJnNfuVWXAIWLJoGA6GRx6HUtF3BtDDTBYX4Yw8Tlq0uV S9IzbTc1+NHw8CjC/ELmG0DWw6Kefaiapi/QE2yorKQSFBhth+c9ZRlhCTJKtJ1Effje TUOQ== 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 ga19si58025ejc.243.2021.07.01.06.50.18; Thu, 01 Jul 2021 06:50:44 -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 S232302AbhGANvB convert rfc822-to-8bit (ORCPT + 99 others); Thu, 1 Jul 2021 09:51:01 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:42691 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbhGANu7 (ORCPT ); Thu, 1 Jul 2021 09:50:59 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MbC5g-1lNQNB0bOa-00bea9 for ; Thu, 01 Jul 2021 15:48:05 +0200 Received: by mail-wr1-f42.google.com with SMTP id p8so8363690wrr.1 for ; Thu, 01 Jul 2021 06:48:05 -0700 (PDT) X-Gm-Message-State: AOAM530abvLYt3dNOD/5arE1cZwBwYdM4zr81rpx0VP1cP0Q8M6ciRTt kQaj4ianmEGomTFyiqAy5+kh8wwpzbkzFIdJywU= X-Received: by 2002:adf:ee10:: with SMTP id y16mr8597924wrn.99.1625147284809; Thu, 01 Jul 2021 06:48:04 -0700 (PDT) MIME-Version: 1.0 References: <20210701125046.43018-1-wangborong@cdjrlc.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 1 Jul 2021 15:47:48 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] sched: Use WARN_ON To: Christophe Leroy Cc: Jason Wang , Jeremy Kerr , Linux Kernel Mailing List , Paul Mackerras , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:T09Rvhe+PT3OlD2s3Iy9jYzh4y22x5uM7vjO0+3/kynE5tzBgfA /wmC7Kw8iNv7+V0T3+kQUju2V6emdrfy7kTDrf6/oACF7n2qiKA4eO85GhdSzUtab7PoNte ak8G3i+fR6Du7wNWsf1yi3HFKHaZetAQDxLPAwZJCeNoB/L+28JNr9nLskWLKvFNsGkhaVK e3hjAwalPPzZslNc5p2Gw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:HMfnvOWeMtw=:ctzxTlIegXfH15jUH92jKB lK3SdnkkaONHwSV894b/cYfwpq1qVubFV5ZiWVVUJ0oprJslQdZcoGSu/a3YcCgy2zGdAhS2R qg46AIgUhQH+br167U10WrD4DgvXidjs5+fwl3WrcporFoFuEHcu7tzfip8+8rzjd4tPMXJJ/ ayVHR5HcLSO7NcW6TdKfmucNXsKCrGVQIBjROE7Stg6gC7e4uk4gViye2xlH2wEhGlYxGefML g8wd92UyJzeeb8gyjuUEZ3k8uqLd+rdV7H9zE2HrkOIW/F5n5CU8WyZhjYNUrYEOkyT2m0SMI cRttg6Y+jc+Fz8cVyJzpDdej0zkSRvzcA8lpggrx4V7+Vkn5Nz8UY2d0egNK85cE+kctANh9r ydUoda7KrmBEoXoPBSPs23ZFz5d4VwSlY9B/Dbulht4kD1TTdDK4QSREoimLK6/tR5nWOTGWl RIj1w2StoTK8TlDYYeNIEFZuQH/iWi79/bwAWWQFquhre6Rrfkv5VxctKcJcX5dvDa34U7TZw VXz+m2cX0mHWGBwLfwGtAfb6ny4AKPdZ4z8TvUZrWsG7dcLSwyUhItLblg82fbMZj+514vdgV uXVQAPSiTqu7hlWMB5xKYbo5oFhahm2FQ34j7wdyz/vhTjYd9WzHc5ypAitKBilBzyYT/+Omk mKqSgNEcqwhtLdLVwAKXFSBZX+9bXwjnD80bRvt2SWIntelh7/dSRyT4Y9H6LBjk9AJmVU7x9 wZH9bFNd4sFxQ8L3eiKtBzzmexPJbEiyhXe28NX7GtYWWTUFKM+gjGDUNnSlHwNIWf3CYruDt 5TyJpefFrphR1NQlDKPcaEEOe0tN9HxtkbqPpcxhYA/+NdNmnSfiyn8JDeWlXJUj5EF1Ex/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 1, 2021 at 2:57 PM Christophe Leroy wrote: > Le 01/07/2021 à 14:50, Jason Wang a écrit : > > The BUG_ON macro simplifies the if condition followed by BUG, but it > > will lead to the kernel crashing. Therefore, we can try using WARN_ON > > instead of if condition followed by BUG. > > But are you sure it is ok to continue if spu_acquire(ctx) returned false ? > Shouldn't there be at least for fallback handling ? > > Something like: > > if (WARN_ON(spu_acquire(ctx))) > return; I think you get a crash in either case: - with the existing BUG_ON() there is an immediate backtrace and it stops there - with WARN_ON() and continuing, you operate on a context that is not valid - with the 'return', you get an endless loop, as it keeps calling spusched_tick() without sleeping. Out of those options, the existing BUG_ON() seems best. Arnd