From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12B60C3F68F for ; Sat, 14 Dec 2019 05:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E276324679 for ; Sat, 14 Dec 2019 05:45:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NGCuLhpC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725877AbfLNFpZ (ORCPT ); Sat, 14 Dec 2019 00:45:25 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:36861 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725851AbfLNFpY (ORCPT ); Sat, 14 Dec 2019 00:45:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576302323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aMoyw7B5Pg5yQ9QR7aJ058W9/8V7Fq7avIzK4TkKuto=; b=NGCuLhpCqmRp9cFt5uHQwwJjGymb6EagpxKBBOmcD9guVUJJz4jYRM68csG+VCQ9RkOI0b 3THRJ2jiuzy2Rho0lEXh/CLX81IvzKG+Dyh/BOMhCtq1XqEdSgBH7rU7P+tIiVoTze3fST /6bTe0h7wEcLcuIUpRJKILVLfPsJdDc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-Pc9bSVpXPkSN5mt7IhrOJA-1; Sat, 14 Dec 2019 00:45:20 -0500 X-MC-Unique: Pc9bSVpXPkSN5mt7IhrOJA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CB8DB107ACC7; Sat, 14 Dec 2019 05:45:18 +0000 (UTC) Received: from treble (ovpn-123-178.rdu2.redhat.com [10.10.123.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87F5063BCD; Sat, 14 Dec 2019 05:45:17 +0000 (UTC) Date: Fri, 13 Dec 2019 23:45:15 -0600 From: Josh Poimboeuf To: Randy Dunlap Cc: dsterba@suse.cz, Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Linux Btrfs , Peter Zijlstra Subject: Re: linux-next: Tree for Dec 6 (objtool, lots in btrfs) Message-ID: <20191214054515.ougsr5ykhl3vvy57@treble> References: <20191206135406.563336e7@canb.auug.org.au> <20191211134929.GL3929@twin.jikos.cz> <20191212184725.db3ost7rcopotr5u@treble> <20191213235054.6k2lcnwa63r26zwi@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Fri, Dec 13, 2019 at 04:04:58PM -0800, Randy Dunlap wrote: > > diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h > > index b2e8fd8a8e59..bbd68520f5f1 100644 > > --- a/fs/btrfs/ctree.h > > +++ b/fs/btrfs/ctree.h > > @@ -3110,14 +3110,16 @@ do { \ > > rcu_read_unlock(); \ > > } while (0) > > > > -__cold > > +#ifdef CONFIG_BTRFS_ASSERT > > +__cold __unlikely > > what provides __unlikely? It is causing build errors. > > and if I remove the "__unlikely", I still see the objtool warnings > (unreachable instructions). Ha, not sure how that happened... Should be __noreturn instead of __unlikely. Cheers... diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index b2e8fd8a8e59..398bd010dfc5 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3110,14 +3110,16 @@ do { \ rcu_read_unlock(); \ } while (0) -__cold +#ifdef CONFIG_BTRFS_ASSERT +__cold __noreturn static inline void assfail(const char *expr, const char *file, int line) { - if (IS_ENABLED(CONFIG_BTRFS_ASSERT)) { - pr_err("assertion failed: %s, in %s:%d\n", expr, file, line); - BUG(); - } + pr_err("assertion failed: %s, in %s:%d\n", expr, file, line); + BUG(); } +#else +static inline void assfail(const char *expr, const char *file, int line) {} +#endif #define ASSERT(expr) \ (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))