Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1486978yba; Thu, 4 Apr 2019 11:45:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVMavHl0VGBqkwqTikMNRlcdG3bOuHg69RqEtT9StrnYMAg24U2NdALuJkAXJch2SFLj+T X-Received: by 2002:a17:902:f089:: with SMTP id go9mr7733331plb.309.1554403523984; Thu, 04 Apr 2019 11:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554403523; cv=none; d=google.com; s=arc-20160816; b=Ft7aH5Ow1SO5ukxNsJ9HQRwCd01g8Gy6yRdeigeWw3b4yFJlFXzImIQWk1LY68iIhf XfEuWIS0pw18ZHGx69X0f99kycPvleBXL6CjhUCgAECo8ZuhZtrOD23aKiEuxwc9wpUz BfNgp3XzNabyEmE6yZcdTE7eMgkojEL+DVeiTWI3xHsyKn4CwucSBDoQvUOU1mH0zeEj 1EJCaatlNtRHcYn/xsbwIP2K4V3aoO1Jl1zElxT4iJ6H9It9cXME/MlsCK1R3Ux+4VGN iyMsL88FQecLQbU0NA76ml7hkqYOuU8SHgh2ZAo9BtemTEDhEe5kHN7PK7Pe3T5xnBzF UJbQ== 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 :message-id:date:subject:cc:to:from; bh=7aCRF8EqM5Jgz70rWIjg6OSw59pJw0JUWPPrIPKv8Ao=; b=TkbXtFREIE6Zxas2n7n327OwthZ8YFuHZCH5kB99Sw0+ymH0q5yDdh6X0D8KHcvMLd PXFiBJ7h1gwSanl88VOPN4PRy8RtIiwQnPYLRN/j2JsQ4d4ThyMkUnJale50SMWMcXo2 fjDs5yOAsplXvP224+hGz0tf+nBB/T+hiR6juAnxFvYMPmyjI7/lVIF7QPhRw+r3rN8x Se9JDV2nwbahCcfwxzhqPx99cGkHwcOdvparrudZig3inMODjFJyFrkkzQeMNIGi/yUW FhQkXy/tHK6dXrikYd694isDPMuhcvnXv9Ia/Ui7V2pgUIM0MXycXlOcVzb5opZGm2V/ uNtQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l33si17216436pld.309.2019.04.04.11.45.08; Thu, 04 Apr 2019 11:45:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729831AbfDDSo3 (ORCPT + 99 others); Thu, 4 Apr 2019 14:44:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:51958 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728934AbfDDSo3 (ORCPT ); Thu, 4 Apr 2019 14:44:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8B69BAF19; Thu, 4 Apr 2019 18:44:27 +0000 (UTC) From: Miroslav Benes To: yamada.masahiro@socionext.com, michal.lkml@markovi.net, jpoimboe@redhat.com, pmladek@suse.com, jikos@kernel.org Cc: joe.lawrence@redhat.com, ggherdovich@suse.cz, linux-kbuild@vger.kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Miroslav Benes Subject: [PATCH v2] kbuild: use -flive-patching when CONFIG_LIVEPATCH is enabled Date: Thu, 4 Apr 2019 20:44:11 +0200 Message-Id: <20190404184411.1392-1-mbenes@suse.cz> X-Mailer: git-send-email 2.21.0 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 GCC 9 introduces a new option, -flive-patching. It disables certain optimizations which could make a compilation unsafe for later live patching of the running kernel. The option is used only if CONFIG_LIVEPATCH is enabled and $(CC) supports it. Performance impact of the option was measured on three different Intel machines - two bigger NUMA boxes and one smaller UMA box. Kernel intensive (IO, scheduling, networking) benchmarks were selected, plus a set of HPC workloads from NAS Parallel Benchmark. The tests were done on upstream kernel 5.0-rc8 with openSUSE Leap 15.0 userspace. The majority of the tests is unaffected. The only significant exception is the scheduler section which suffers 1-3% degradation. Evaluated-by: Giovanni Gherdovich Signed-off-by: Miroslav Benes --- The patch is based on master branch of the livepatching tree on git.kernel.org. Many thanks to Giovanni who ran the whole testing campaign and analyzed the results. I archived the dashboard and detailed data. If anyone is interested, we could probably set up a public website somewhere. Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index f070e0d65186..464a693a22e9 100644 --- a/Makefile +++ b/Makefile @@ -789,6 +789,10 @@ KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections LDFLAGS_vmlinux += --gc-sections endif +ifdef CONFIG_LIVEPATCH +KBUILD_CFLAGS += $(call cc-option, -flive-patching=inline-clone) +endif + # arch Makefile may override CC so keep this after arch Makefile is included NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) -- 2.21.0