Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2701004pxb; Tue, 13 Apr 2021 08:10:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmrFWN0DX3nkx5b1ijLN00d13qcDPRsvpvi/FeH9Pf5gdpXfW7oHTJK4QXSVS9lF8Ucoxy X-Received: by 2002:aa7:984d:0:b029:24c:8251:6d93 with SMTP id n13-20020aa7984d0000b029024c82516d93mr10753310pfq.34.1618326648757; Tue, 13 Apr 2021 08:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618326648; cv=none; d=google.com; s=arc-20160816; b=mhTJZCs5jOoc4+p1AftLnAjEm2CtSdInD97YO1Ya+T7GjpY+QNu4KwrfLA8KHhxHND eHkZG4F+rFvMMqfbZ3fCYU2aCilP3tTKpUQp4urhnnVe/iAFPmsNzOwtRaiQXxEPuFeD faCaBGN23szgZSAesSlOWz37chmEpN4zw98LB5+rnxpeQJqhNu6XInY3etKxWswL/8RL 4nc2rDjEsB5rWajDNTDAkjtUgUJUM8i8WXmUDECX9AdcOjDhpXfm+NvjLdGTluyEFZl9 GmCicXaD6vw6GUwxVcVfVkdVTHPqL/soTl58LW6yxoQOQ3lpdDc+xP8OTSLr9MT0YbJ/ cY8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cS4qFYTrQyLG9nh0K2HoBn2JDeT6suPO8a0ZG4SLVvQ=; b=U8ZleSaQxGSwh6XubueaMJ+iY2aBNbt8p1YTcPAxn2o22MH/rL/ilTLiDpLwbea5NZ r7F0H3OPbZZD6k04HDZNNt8z4lf8jMvG/NDevYE9Qbj7YmCz3Q/EtvO0hCdP9/4fWFwS lgLe1xXzqCKvYX7xAz80LWDNcSJerUCoCFSZCC6i0mLPgBa3rUJh3TwbWJ0s9ndWtBMC iy4aAJjiUzVozmyQSAy4hh7+gikLDX7FQsVwAEGUxplADavDjxm+mNxnXMaTWvgjPL+U 8tf7wMgQInuxradRVJM4zgytgjOPcvIog4LgdnrM1ien3FnxzKIlfnt9I4HwQ8yd6Mox tFIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBSiHaQv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ng8si2777057pjb.68.2021.04.13.08.10.13; Tue, 13 Apr 2021 08:10:48 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBSiHaQv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242748AbhDMMnu (ORCPT + 99 others); Tue, 13 Apr 2021 08:43:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:48722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242649AbhDMMnP (ORCPT ); Tue, 13 Apr 2021 08:43:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6813611CE; Tue, 13 Apr 2021 12:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618317773; bh=DyUmwNhpXMdsOI3cyerl65s6TqAzbtvBayxAyHLmjRw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GBSiHaQvO6iLOwVNCPe9i+i5LW7JJRp/S+WokBi9PchSnbtV+izlDbVruz76LQ7L6 xJom0RmzeGN/qIzXE0bPAa3DkZBYWGMsfwofQFTKMEFBaoXNYhntR908uY1H/hVNhp p6xrYkLzwYthd1P2KA4be+Va+hR7rL8mfkRUn7uPTi8N05KyR5fUZ6SjRd//Vo9AkQ Y+2lh/01Iu36T4aLifjOJyMXLVUTsGTPBeGHvFXGCF7d89sxGnL7e12whV6/lD64lW IkkbKxMhH6vwz20cYMj6NHMbJnbJMfSmvQPiYA8aGD5aM2gALVfso1nUmXczExe3J7 GZkqxyCUgdxMg== Date: Tue, 13 Apr 2021 14:42:49 +0200 From: Jessica Yu To: =?utf-8?B?5ZGo5Lyg6auY?= Cc: linux-kernel@vger.kernel.org Subject: Re: Re: [PATCH] kernel/module: Use BUG_ON instead of if condition followed by BUG. Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Linux gunter 5.11.6-1-default x86_64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ 周传高 [13/04/21 15:21 +0800]: > >>+++ zhouchuangao [30/03/21 05:07 -0700]: >>>It can be optimized at compile time. >>> >>>Signed-off-by: zhouchuangao >> >>Hi, >> >>Could you please provide a more descriptive changelog? I.e., Is this >>a fix for a cocinelle warning? What are the optimization(s)? >> >>Thanks, >> >First, >This patch comes from cocinelle warning. > >Second, >#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0) > >BUG_ON uses unlikely in if(). Through disassembly, we can see that >brk #0x800 is compiled to the end of the function. >As you can see below: > ...... > ffffff8008660bec: d65f03c0 ret > ffffff8008660bf0: d4210000 brk #0x800 > >Usually, the condition in if () is not satisfied. For the multi-stage pipeline, >we do not need to perform fetch decode and excute operation on brk >instruction. > >In my opinion, this can improve the efficiency of the multi-stage pipeline. Thanks. Could you please modify your commit/changelog message to include this information (including the coccinelle warning) and resend the patch?