From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E08821FBF50; Tue, 29 Oct 2024 19:13:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730229183; cv=none; b=Vz4UgvMYbWvFr72RnRsas8UkXGwqXpLWcU75PGjWALCJSDpPJpLAEY9ZjAYuTQ3+3liYYOmeG9ZvB9Vt46yZkIvEwaSnoy1Y2Q2I+lglCed2EpfzThhrlKLHoJHkIxVzgPrMxoJv529nUQhm2td48T7WroUYRFcASr1kb/5eNjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730229183; c=relaxed/simple; bh=kVYtwcfclxpvBW30S2RwWocigUFMTa1azVLZdYZRh5E=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=cSwnp72HPtGnoBnHWXR4Vyzg4TCvdZ4vpHe/3Wijof36WUdjLu6z7g9B9hgUBpycPcOGmoGsmwtIdNOtwybXX192jdEgJAZTGWaJ9smRIZL9/763UCSqONwIyylFtczcBGI1+bs8Dlzul71DdUGKwvR5mPS54euqLpC3PVNksrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LteSbu9X; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=tffWXmsp; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LteSbu9X"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tffWXmsp" From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730229180; 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=nNDoZlvVc72wsuMOc+bkf/3VOAqrrScR8m3Zau9Vv2A=; b=LteSbu9Xs2VfzjzEJkuyON+4kl2xG6qdPp8l31+3semXp8JX+wELAol3bGKIObe2tC8qgZ r/STTisUNB90uUbxwASGC3zhmFIgz4HdCDWJ8xEIQl/+K5mHMFxoNuqo0ZLaEDvZPckodY Z8XS99mlhVFgp7za0qYgZUjaUCtVxgjcsQdOvp0LwCqhMCh6x+fh/yRfHObDJCQoBgQbIP uXtSvLiB/RJ383jc4ZUkzMBjcu8U3JPeBu5y0eUDtDarHfjnSuoL5XAuphDp4DcuYciNqf QyG5YZkWHdLLQBGYL1zxZrv1NWff66znqDKl1X+4MKqkdUQxnQCNZZI9aCo8uA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730229180; 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=nNDoZlvVc72wsuMOc+bkf/3VOAqrrScR8m3Zau9Vv2A=; b=tffWXmspbsG8CjVmPkNj8bsXifiOXLbwPOM8E71lx8cYAnHl21ExdcKl3ZFuIiOMh3MolO XUK1hXHPM3igiTBg== To: Junaid Shahid , Brendan Jackman , Borislav Petkov Cc: Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Sean Christopherson , Paolo Bonzini , Alexandre Chartre , Liran Alon , Jan Setje-Eilers , Catalin Marinas , Will Deacon , Mark Rutland , Andrew Morton , Mel Gorman , Lorenzo Stoakes , David Hildenbrand , Vlastimil Babka , Michal Hocko , Khalid Aziz , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Valentin Schneider , Paul Turner , Reiji Watanabe , Ofir Weisse , Yosry Ahmed , Patrick Bellasi , KP Singh , Alexandra Sandulescu , Matteo Rizzo , Jann Horn , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org Subject: Re: [PATCH 01/26] mm: asi: Make some utility functions noinstr compatible In-Reply-To: References: <20240712-asi-rfc-24-v1-0-144b319a40d8@google.com> <20240712-asi-rfc-24-v1-1-144b319a40d8@google.com> <20241025113455.GMZxuCX2Tzu8ulwN3o@fat_crate.local> Date: Tue, 29 Oct 2024 20:12:59 +0100 Message-ID: <878qu6205g.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, Oct 29 2024 at 10:38, Junaid Shahid wrote: > On 10/25/24 6:21 AM, Brendan Jackman wrote: >>> I'd expect you either always inline the small functions - as you do for some >>> aleady - or mark the others noinstr. But not something in between. >>> >>> Why this? >> >> Overall it's pretty likely I'm wrong about the subtlety of noinstr's >> meaning. And the benefits I listed above are pretty minor. I should >> have looked into this as it would have been an opportunity to reduce >> the patch count of this RFC! >> >> Maybe I'm also forgetting something more important, perhaps Junaid >> will weigh in... > > Yes, IIRC the idea was that there is no need to prohibit inlining for this class > of functions. I doubt that it works as you want it to work. + inline notrace __attribute((__section__(".noinstr.text"))) \ So this explicitely puts the inline into the .noinstr.text section, which means when it is used in .text the compiler will generate an out-of line function in the .noinstr.text section and insert a call into the usage site. That's independent of the size of the inline. Thanks, tglx