Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2486558rdb; Mon, 20 Nov 2023 12:09:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbOCQaCPjpUytJCOjeWcV2UlzOaIYzAe3W3IGU4AO50PEwc6Fw/l2Vq5Lh6YycbDtEu6Sx X-Received: by 2002:a05:6a20:a121:b0:187:7ca4:c71f with SMTP id q33-20020a056a20a12100b001877ca4c71fmr656492pzk.28.1700510949381; Mon, 20 Nov 2023 12:09:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700510949; cv=none; d=google.com; s=arc-20160816; b=gd0OmC7cbJVZTyAPRDY3iHQL+SdsM/uxPFo9UCE3PHlCs6xehU1oMfuehwBga8faex 9u6ESO1plC0F8Q6OpAtDisX+n9OfsTFANhOBm6AHES1wIX4cqaMFoVK6sw55lnf4KKlf fLqWILqMS9uE9oJSgpss1lrtTIXscsdjXCcjjzloPvdlNa5d106U2xSkpNmLW0h7MO1H XIx4ShRyaVj5sL6mu4T/9z6E+vT9pA8YbQ1t0Dpx0OxOiza0sof/OjOjXVjmPBT4xPVc 1OwpMclD9oUrIQCZXjAzw16wgwMZkciVP6CmrEXNQowjgDfbi7DHunnFC4SYvNwHvdYM v5KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hlzpo+YsdsQKvd2H5RJrvAcwaDBP6RZS4nZKMO9ZtX4=; fh=SBpw61mOVT4S9DSNa8wbPMWahoVI6l9aFsuZqyyM2PI=; b=B611eLoyJZpj3eJVF4pqzf3gtZdPQ6mXiCS2i/4eI6dSz4F7ZQ2cQxUBj7aJ+t6kQN jc1vS7+lov6mDEDSjpm34Tdv3CHzHu+7qR6q/PK4kO5n13RTfBhwFpKqMhHEmXtoFBz3 bfBd4LZ4loN6ycELS9xdHPw/SLkimdMsTcABk5dVcD1i21R8Ii6CJIvDLuYqfQlU/ZVV /4o+mN/Whu0BY5pXWPjTQX01dOOv7bvQ4MpIXPkTRAlTRVuOiutjfTa1R/PG1kSt0J4B YsZ8u2a+W59lDvlKyMqF4loVorNjgfIKIMxBCeiSjSrTwzAM9FP9ZpfGDQA9PgtN+osm B07A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QrJ6G2ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k11-20020a6568cb000000b005859b2d8d7asi8913610pgt.4.2023.11.20.12.09.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 12:09:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QrJ6G2ZA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0BDB4802B076; Mon, 20 Nov 2023 12:09:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbjKTUJA (ORCPT + 99 others); Mon, 20 Nov 2023 15:09:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjKTUI7 (ORCPT ); Mon, 20 Nov 2023 15:08:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA003BE; Mon, 20 Nov 2023 12:08:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700510936; x=1732046936; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rU+hV0Dwyl2lU7FcgPXL3hIp8mCrdq1swhV5294kYhg=; b=QrJ6G2ZACJSP7sKnNNRSg3ER0HU62s5+cGBpH1qgEZz73UUQ4diORoVd wGeuv/UG9ZZAq0IxcQLvXaPbYTcUFdxYN8bAYm9z4w+MbK85WIY7JTpLz BEETmXRmDuJkx4UTlTKAaTLNwIYT+FHfBuzoUVzJ6qFGswRk7f3GrkTKC 5MPMxhU7HCTm3bQ79hToRup6NGLJodtq7jaodVPxt4ZLtt19ddsxp9F3S jbkrlXra01QdVLuOKI5vv++mXhlV/dnf/RZKrroZYO3eMa43NVJ4Ymh7+ 75ll0BiB3FNRxZCrhuqujUll3f3wtDRApDLsPswTIz7DHLuThGUhnZf48 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="10367114" X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="10367114" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 12:08:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,214,1695711600"; d="scan'208";a="14270125" Received: from tassilo.jf.intel.com (HELO tassilo) ([10.54.38.190]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 12:08:55 -0800 Date: Mon, 20 Nov 2023 12:08:50 -0800 From: Andi Kleen To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] kbuild: Add inline-account tool Message-ID: References: <20231115004932.650702-1-ak@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 12:09:00 -0800 (PST) > > > + sym_sizes = [syms[x + 1] - syms[x] for x, _ in enumerate(syms[:-1])] > > + sym_total = sum(sym_sizes) > > > This is equivalent to > > sym_total = syms[-1] - syms[0] > > isn't it? No it's not when there are gaps in the symbols, which always happens in the kernel. The previous version used the range but that led to inbalances. > def get_ranges(syms, threads): > > ranges = [] > prev = syms[0] > i = 1 > > while threads > 0: > > boundary = prev + 1 + (syms[-1] - prev - 1) // threads > > while syms[i] < boundary: > i += 1 Note the boundary is not the address, but the sum of symbol sizes -Andi