Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5045844imu; Tue, 8 Jan 2019 10:31:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Sp6dMYQMTEamREegz2A5msZFwRCjWySaoG6PDV9rBVH/rp0PrAGhERbVyM2IDAPhdBe8u X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr2742823plb.251.1546972282958; Tue, 08 Jan 2019 10:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546972282; cv=none; d=google.com; s=arc-20160816; b=N/lLcPAWn678g/zOKUoEXVf4DzKn3tqu58HI3aspcD80g1NPtFf+K/5XLFWFBhTIXB lRA2HJqt4Gk5SMET5+NmuEeWr6cav2E+Crw3d5WoV0gEB5tXUlaP7QCMaDoHjhD9W3NE p1kTw2yljYXyE8lMihAY3WD8aHiI0L9jTTNuhj4D8D1r9QnBMf9lN8ziyHnwZOFk2Qhf DGZZORqO3mnw6aJRpC0yCnZfUXUC/fG8FnFmA8wKPdC7LqSSMa+jK4rcuUWwtKoZCB7g bPjGEhXw9QTdIPqypD4OWhY21o/MUYen5+8q+N9aGSVbbVPhHgfw5qiJ4fFPcE+jxapu M4IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=IgxxlltM/YqbmfuqUTo2lubz3lYM7XgPxxZCMRDDDTU=; b=qI3uUZBzzTRFfXk+PToHea8O36vdC3CIKtOTCKeOX3A3Pl3LRxq4MzV9DxjSUw21aJ TK64ceuc7xk76woi0aL6o840H27h3pGT9bqYdZHNAk4nT2yD0grtbaEwt1+nVqe3W1Vl SZrOrlnCinBzNny9im99ayWluxPY9kXRqgRFHUqw0n9lFj092BKfih0WghWml7J5kuOt sU2qwJRQD64lBxc7nbOtuaEaSl9/8xd10QUfrYuKlZWfLZlyRPi6pK/VrjED7UhFrRgM P8bMuM/6XwJxSrnUg78s81fwe/KUBx9h1Cl+c7Jaghsfq8Ya8fmofIR+G+03CUnmTYgO a79A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="lelDa/4M"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c139si4036679pfb.281.2019.01.08.10.31.06; Tue, 08 Jan 2019 10:31:22 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="lelDa/4M"; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729336AbfAHS2H (ORCPT + 99 others); Tue, 8 Jan 2019 13:28:07 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45373 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728752AbfAHS2H (ORCPT ); Tue, 8 Jan 2019 13:28:07 -0500 Received: by mail-pf1-f195.google.com with SMTP id g62so2306289pfd.12 for ; Tue, 08 Jan 2019 10:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IgxxlltM/YqbmfuqUTo2lubz3lYM7XgPxxZCMRDDDTU=; b=lelDa/4Ms0BXyqG/l2s/e93o5TSTiyMnUw2sE3LCru82utmF6n8E+XPb8rCqZE8Kvz XhoUXyUbM7fhOuDp4mc1+5gKSt63upQIamlQeGXAkTAHvm2Tn14ckflT8Xwv9g09s1Cm sePXPY1HfTE7TaSH1rEtiw0eYygCbumRtFcyE0+CHOh/pin5jb8ud3NGdCAGHrh1A6Qm 4/3aUJ8JJwzxeaO8vmy2sJGpn6XCoFWgDSrYdIq5ZsA23e2Aqz4odgL5s4UsaqIr/lHe PkcAMpTBMpEEaYc885GTxVihX9sYmD4fqif76YLQ7N5sX5XlkWoVVmcAQ7kpmtUu+e0J VDcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IgxxlltM/YqbmfuqUTo2lubz3lYM7XgPxxZCMRDDDTU=; b=hnayPXtz1SS63H4dsSmaF1R/9byPOtaKEFu01xfAucnkIh1yH5zmo8GMilUkSvK8ec TL7DAWVPraahuGDfzgl8hWqNffNOJg4KL3rbQLyJi7ulOMhPrgAE4p2AByZHY8PXQJDW E/C2b5Bs29PfoMk4goyqujy3EGQBF9G+tlahPTfM7HXarmMlZ9hWEZD/qwrP6F62m7ia MtwFcJF06wgXO+qNa+FZXsZ7TyPMqcQtFP8MaTKnfR8pGh6ByqMAzV4PAvKq6XHPi65b wPpR2hXkdFvpatRit2Z6TkmUGUnOsVDr2ASicpPG7zw4ciuMJlpf7kI3/ipKUY/Wn6J9 enJQ== X-Gm-Message-State: AJcUukfe/CHWVtnnPScHmNoPFY3qd1G3BHYOYugcJiqjpogEv5GMLO1n yhsSJAfTmsMUBFSI+aomQ9A= X-Received: by 2002:a63:ff16:: with SMTP id k22mr2504152pgi.244.1546972086123; Tue, 08 Jan 2019 10:28:06 -0800 (PST) Received: from [10.2.13.140] ([208.91.2.1]) by smtp.gmail.com with ESMTPSA id z62sm119969940pfl.33.2019.01.08.10.28.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 10:28:04 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [RFC v2 0/6] x86: dynamic indirect branch promotion From: Nadav Amit In-Reply-To: <20190108172721.GN6118@tassilo.jf.intel.com> Date: Tue, 8 Jan 2019 10:28:02 -0800 Cc: Peter Zijlstra , Adrian Hunter , Ingo Molnar , Andy Lutomirski , Josh Poimboeuf , Edward Cree , "H . Peter Anvin" , Thomas Gleixner , LKML , X86 ML , Paolo Abeni , Borislav Petkov , David Woodhouse , Alexander Shishkin , songliubraving@fb.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181231072112.21051-1-namit@vmware.com> <87zhshe66w.fsf@linux.intel.com> <20190107163227.GH14122@hirez.programming.kicks-ass.net> <20190108092559.GA6808@hirez.programming.kicks-ass.net> <306d38fb-7ce6-a3ec-a351-6c117559ebaa@intel.com> <20190108101058.GB6808@hirez.programming.kicks-ass.net> <20190108172721.GN6118@tassilo.jf.intel.com> To: Andi Kleen X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 8, 2019, at 9:27 AM, Andi Kleen wrote: >=20 > On Tue, Jan 08, 2019 at 11:10:58AM +0100, Peter Zijlstra wrote: >> On Tue, Jan 08, 2019 at 12:01:11PM +0200, Adrian Hunter wrote: >>> The problem is that the jitted code gets freed from memory, which is = why I >>> suggested the ability to pin it for a while. >>=20 >> Then what do you tell the guy that keeps PT running for a day and = runs >> out of memory because he likes to JIT a lot? >=20 > It only would need to be saved until the next kcore dump, so they = would > need to do regular kcore dumps, after each of which the JIT code could = be freed. >=20 > In a sense it would be like RCU for code. >=20 > You would somehow need to tell the kernel when that happens though > so it can schedule the frees. >=20 > It doesn't work when the code is modified in place, like the > patch in the $SUBJECT. Excuse my ignorance - can you be more concrete what will break where? I am looking at perf-with-kcore, and intuitively the main thing that is required is to take text_mutex while kcore is copied, to get a = point-in-time snapshot. Is it really that important for debugging to get the instructions at the time of execution? Wouldn=E2=80=99t it be easier to annotate the = instructions that might change? After all, it is not as if any instruction can change to = any other instruction.