From mboxrd@z Thu Jan 1 00:00:00 1970 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 63BC7C001DE for ; Tue, 15 Aug 2023 16:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237782AbjHOQxp (ORCPT ); Tue, 15 Aug 2023 12:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236589AbjHOQxO (ORCPT ); Tue, 15 Aug 2023 12:53:14 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E511B2 for ; Tue, 15 Aug 2023 09:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692118393; x=1723654393; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sTQIaXCrzI/ym6V65Yk6O8oSu9EVhRhxGtTrLsAYcfQ=; b=iFCivBrL2I/45gjwSwWxXPehF3zr9WkMJB1jlKvOCbrd5rWkf8B+pxfX L56+iqFj4Dr4e7P2HLJNpbs9/Xh/lkiGvJP7OjZ0zes5YhSHLgyuNkl4t tGWy2dN6q0O7flwGVqJFGaNxG5Qhhqcm/L8C8wRr2/+Tvt9ZnqDFYFlyh tZMBuJc8vhZCt0onbS2xYsuA/cfHB3aN/GNwLB/EvHdslKFASdhghVCQN XEsVH/eiljq1GCnIzEwUa+mxOoLJS+6/KKBmM4fTiOYglmgsedHk9glVU JtetnrMfOwQIFeYWzqtNylqUGsPax3geArAI7zD5jcHNEpn4QMyzXdm5X w==; X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="436218094" X-IronPort-AV: E=Sophos;i="6.01,175,1684825200"; d="scan'208";a="436218094" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2023 09:53:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10803"; a="727423435" X-IronPort-AV: E=Sophos;i="6.01,175,1684825200"; d="scan'208";a="727423435" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga007.jf.intel.com with ESMTP; 15 Aug 2023 09:53:11 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qVxI5-00ADJ0-1L; Tue, 15 Aug 2023 19:53:09 +0300 Date: Tue, 15 Aug 2023 19:53:09 +0300 From: Andy Shevchenko To: Yury Norov Cc: Bartosz Golaszewski , Rasmus Villemoes , Thomas Gleixner , linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 1/4] genirq/irq_sim: dispose of remaining mappings before removing the domain Message-ID: References: <20230812194457.6432-1-brgl@bgdev.pl> <20230812194457.6432-2-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 15, 2023 at 09:09:10AM -0700, Yury Norov wrote: > On Tue, Aug 15, 2023 at 01:38:49PM +0300, Andy Shevchenko wrote: > > On Sat, Aug 12, 2023 at 09:44:54PM +0200, Bartosz Golaszewski wrote: ... > > > @@ -16,12 +17,14 @@ struct irq_sim_work_ctx { > > > unsigned int irq_count; > > > unsigned long *pending; > > > struct irq_domain *domain; > > > + struct list_head irqs; > > > }; > > > > > > struct irq_sim_irq_ctx { > > > int irqnum; > > > bool enabled; > > > struct irq_sim_work_ctx *work_ctx; > > > > > + struct list_head siblings; > > > > You can reduce the code size by moving this to be the first member. > > Not sure about struct irq_sim_work_ctx, you can play with bloat-o-meter. > > Pahole you meant? No. I meant bloat-o-meter. ... > But as Bartosz said in the other email, "it's just good practice > resulting from years of" kernel coding to have: > - members declared strongly according to the logic of the code, and > if no strong preference: > - list head be the first element of the structure, to let compiler > avoid generating offsets when traversing lists; Exactly. > - put elements of greater size at the beginning, so no holes will be > emitted like in the example above. > > So I'd suggest: > > struct irq_sim_irq_ctx { > struct list_head siblings; > struct irq_sim_work_ctx *work_ctx; > int irqnum; > bool enabled; > } Yes, I like this. -- With Best Regards, Andy Shevchenko