Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86D48C433F5 for ; Mon, 10 Jan 2022 10:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243916AbiAJK2g (ORCPT ); Mon, 10 Jan 2022 05:28:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239431AbiAJK21 (ORCPT ); Mon, 10 Jan 2022 05:28:27 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D77ADC06173F; Mon, 10 Jan 2022 02:28:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5ujuOQpALmWNb+JnVkNXks4oy9Vot+hJ1tVe7cai2Bo=; b=RgJAIg7QuUrS4CP360xltXYM/5 xP3V5zg+ztj1yY2vUCPu6g19KHW5lfiS0Pz/I+9EmlA5uMzORzL+eruuQh44UGXWT1fiCgP7nl1Ov BzUOATcv42sXj1wuQ/nYPU30iLVzhAP27Pnj2QSU1lN+TFtJbraBYeodIHZg961mbkRHorL6wJ01P IQ4IGFbppwBiP+x5tClglrj90RmSK43pkt1JemvPtb7rXc8k09gntq3o5Q4ISwhcW5zmDR+ZPQRn6 bPXbI9w8SLCiMQduYaisxsrzFWezgqVxFDcYNQcST+TUJ8Pk5X5hbH4YLstUYxHUBb3+zKWd0gKlu z/zDfy9A==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1n6ruG-000Nph-Gd; Mon, 10 Jan 2022 10:28:04 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 23C43300237; Mon, 10 Jan 2022 11:28:01 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BE06020195520; Mon, 10 Jan 2022 11:28:01 +0100 (CET) Date: Mon, 10 Jan 2022 11:28:01 +0100 From: Peter Zijlstra To: Ingo Molnar Cc: Greg Kroah-Hartman , Linus Torvalds , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Andrew Morton , Thomas Gleixner , "David S. Miller" , Ard Biesheuvel , Josh Poimboeuf , Jonathan Corbet , Al Viro Subject: Re: [PATCH 0000/2297] [ANNOUNCE, RFC] "Fast Kernel Headers" Tree -v1: Eliminate the Linux kernel's "Dependency Hell" Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 03, 2022 at 05:29:02PM +0100, Ingo Molnar wrote: > Yeah, so I *did* find this somewhat suboptimal too, and developed an > earlier version that used linker section tricks to gain the field offsets > more automatically. > > It was an unmitigated disaster: was fragile on x86 already (which has a zoo > of linking quirks with no precedent of doing this before bounds.c > processing), but on ARM64 and probably on most of the other RISC-ish > architectures there was also a real runtime code generation cost of using > linker tricks: 2-3 extra instructions per per_task() use - clearly > unacceptable. > > Found this out the hard way after making it boot & work on ARM64 and > looking at the assembly output, trying to figure out why the generated code > size increased. :-/ Right, I suggested you do the per-cpu thing. And then Mark reported that code-gen issue on arm64. I'm still thinking the toolchains ought to look at fixing that. It'll be too late to use for per-task, but at least the current per-cpu usages will (eventually) get better code-gen.