Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp65899imm; Thu, 30 Aug 2018 15:59:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ4kUN9HWiPaw6XAm7lyXRSF8c/IcdRwUHc6BAs4C7XN2babob8dDtBNZUpo3QM4Ad5RpBb X-Received: by 2002:a17:902:b40c:: with SMTP id x12-v6mr12333463plr.163.1535669955924; Thu, 30 Aug 2018 15:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535669955; cv=none; d=google.com; s=arc-20160816; b=oTp0WqLy1LaREKvXpLUW+3+Ped7KZ7bH69dYA/nh+ok1UlVOdGhR+IaIjrSA83kq6V SaaeBnQnao1doIyVTv3qaxUh82Fknp7BReacCwxmJZyVunHWw304igENNL0wYsQt3CD2 QtjhojwyPW7SsovtjqunQ0FTQYpwKm6rMpurz0uw5+bcxzi77w5wwW2Uo3ArfCqyQ6iR KJsIfK00PIvlwad7n0NU6lnXtgw2rt2xjVGDhiNXBEvIEu2785L+syjKVoTfsgA7Cd4r ZAahq37Cg0jt/4mXNjuR/ARVwdoOQrqNbE/Zqnhqu7H6LywEJhTAFfWK1oqB6H9IJzjP nOkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=Uh3rUbTA72ffcOfk4+7Wim6CAVUdnooZ3OV3XmFX0ew=; b=hjBQbKfw9Grbeqj6NFCJL3Gz6rrNUVJnC3FFozsgIITzc1pcBeuTB/htmiviQOFs1X ZcFrVGxyVxBWR6pa2HNeTR98++p5iOgi5daGL/fBBFPQO7TEDL3crvX1LXvbT17JV0or +EipWxrOkBYMKVGbVdrq1V8CP5+V+TDfRsloKSKxIr2TyM6khWANsm4MtMCkeS2jIlBR g+n6zdBTuQCfNQHjBL0Gybh54/v9fPi7m53AcoiKqmMkrVLQKQ/RSWM994XmqbaAHRRS p79JVfPVNJ/qcf7gwqlQTrAx2tPh86D2UYab5E+7Q2xLVcXeI7idRL2xPk4SOMV3bMQJ lqLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=akPRnskk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14-v6si7521057pgg.67.2018.08.30.15.59.00; Thu, 30 Aug 2018 15:59:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=akPRnskk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727211AbeHaDCZ (ORCPT + 99 others); Thu, 30 Aug 2018 23:02:25 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35238 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbeHaDCZ (ORCPT ); Thu, 30 Aug 2018 23:02:25 -0400 Received: by mail-ed1-f66.google.com with SMTP id y20-v6so7724216edq.2 for ; Thu, 30 Aug 2018 15:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uh3rUbTA72ffcOfk4+7Wim6CAVUdnooZ3OV3XmFX0ew=; b=akPRnskkWlL0YubPfZjzM6Gac4ybAivfL7vQdxXlpQ05xcII4IDeRVWED/XFa20ONY auE2PQM31MqcSRbwdt3SRPvo5urvMKgk8dGyluG8CvSSUtAKxFPKO3jidaym0AHfoxx1 a9g4/MIdC+u6qG+1J9I+KBq/XEjc8iFVN9oTFIBPvgCkijKks6VCY7ClcJ5Aehh6sru7 BRYdyvnBF5HtmRnb8nR2HQPdgz7EG0CYsyXddBpjljs+saMaWLT/u0pwrWi8+kqvL4Nj 0yUixJWCcVK9tQr10rr8oU6qMY+iTK3up7sQAJnjdGwp3NBItKkNc4U055qf+ybAjiz/ 8HjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uh3rUbTA72ffcOfk4+7Wim6CAVUdnooZ3OV3XmFX0ew=; b=PuYNP/0w6+6BYVHUNi9+LnjYf+EI1N8jz7QttqOPHKcsSNFqvbPDKhZ/TeFTfDx2nW BU5w/5ybyPrE5C6C13USdLzNvbIoUbtbAIRHaJgqwTIkSKgrOeakxeM4nZlgrauiwjAf B+ftuDsEYjw11edIXOPT4e56P8VnIO6L2A50gZychTv5FrhDk50XrGv1uNHWJGU9K8tL T6649AHMdJKyiA54TD24TjaNi4eS2adP4rZMisnkEepKHTQK1BZpVJmy8hJsNfRr+BoJ xVe0L4oufX6UJK6t9BDhvfjmOaKz0vndtskbOylPcS80uwWds72RKq18xje0unQlbcQc uVjA== X-Gm-Message-State: APzg51AeHliZZKqvrrNPtdGOcfaet6n7e5pF2W16SG154n37NKiA0xeg l4VpftAfO0dNaj+ioW59cWwMqQ== X-Received: by 2002:a50:8e09:: with SMTP id 9-v6mr14593840edw.101.1535669874900; Thu, 30 Aug 2018 15:57:54 -0700 (PDT) Received: from dhcp.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id x32-v6sm4289847eda.81.2018.08.30.15.57.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Aug 2018 15:57:54 -0700 (PDT) Message-ID: <1535669872.23560.73.camel@arista.com> Subject: Re: [PATCH 05/23] selftest: vm: add unlikely() to BUG_ON() From: Dmitry Safonov To: Igor Stoppa , linux-kernel@vger.kernel.org Cc: Igor Stoppa , Shuah Khan Date: Thu, 30 Aug 2018 23:57:52 +0100 In-Reply-To: <20180830223429.30051-6-igor.stoppa@huawei.com> References: <20180830223429.30051-1-igor.stoppa@huawei.com> <20180830223429.30051-6-igor.stoppa@huawei.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Igor, On Fri, 2018-08-31 at 01:34 +0300, Igor Stoppa wrote: > BUG_ON() is unlikely() to BUG() This selftest runs in userspace.. So, we should define the macro somehow, as i.e: rseq/rseq.h:#define rseq_unlikely(x) __builtin_expect(!!(x), 0) Otherwise, [selftests]$ make vm/map_populate cc vm/map_populate.c -o vm/map_populate vm/map_populate.c: In function ‘parent_f’: vm/map_populate.c:26:7: warning: implicit declaration of function ‘unlikely’; did you mean ‘unlinkat’? [-Wimplicit-function-declaration] if (unlikely(condition)) { \ ^ vm/map_populate.c:38:2: note: in expansion of macro ‘BUG_ON’ BUG_ON(ret <= 0, "read(sock)"); ^~~~~~ /tmp/cc7evGVG.o: In function `parent_f': map_populate.c:(.text+0x3d): undefined reference to `unlikely' map_populate.c:(.text+0xbb): undefined reference to `unlikely' map_populate.c:(.text+0x135): undefined reference to `unlikely' map_populate.c:(.text+0x1b0): undefined reference to `unlikely' Not sure if we care for this at all for userspace test. I don't mind as it runs each time by kbuild robot and cumulatively may save something. But it's better be at least compile-tested. -- Dima