Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6645295ybc; Thu, 28 Nov 2019 03:04:18 -0800 (PST) X-Google-Smtp-Source: APXvYqw6zfBYmIDNKdV6byPSlKUPM4z0Kcrg7gRwVu0hOZ4VS13UIZ/9iARIpCrVuuP8VkN2Slls X-Received: by 2002:a17:906:7c5a:: with SMTP id g26mr4937609ejp.249.1574939058028; Thu, 28 Nov 2019 03:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574939058; cv=none; d=google.com; s=arc-20160816; b=NnF8AnyuI1h85Xy5hh5Ob/q6Pwf8t7dgY/Ez8F9Od283KK61Rp2KBH7KXzFxo3c2sH 8Nk67aDY0DU9b1KT4DcVYfRWzjKLt3axbLXiScYGzgeSa6lU6fcDkryaQNd7ME3i+fKN 4VNaZIpeOzMA/hN2pMM04e5QPmM4jbyjYf9JPK6wYJd+fJ5NhlUiBOMEkTwYgUFW9Ucb R03csayHjgjLZc+GCKNdbuJuUvymckq1epC5KrCkWHhEINK6EAhxrfresYlle0rjPzhC aXiyQQNY8PsqMsn3LgdEWN6bErmhjfSykO2LQR0NSzlGwhCTy0hYZyrliG1dsi/Vzt+4 t9gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uhMfsfcGdDSarGayIg5eB45B0YXPtzTjKJrobuyxgbQ=; b=oF419jbD1d7reYA5LU18USa4OSCmdjZpBzH5fTGE+wfQ0dXAbmMgaoHweMRKQ3np7c hDJMsx/YZtZkZObrU6DrEcuNciCKcr8ZbNwt+0dXMwr5izky9gP19kki4mUgulN6GNNP KdmYZajRTkAZ7ecqZ1kWceC55aZdC+POWBY1HbAlrx160U5cVsnIgFbsJtcA7el6paV0 JiacyaAVgNe9XcGxY1hU/m2btMufJtE3sxXWlilTXjGcbCDkFHBUaI/euYL3+FjQ9sB7 APxKoq223bZHWzwzwmxHkX8rI1OZs/8LEqgdXSyDaOCRmVQUdhO5WfAXfmWnsQFFefOP rm7A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si12594517edq.409.2019.11.28.03.03.54; Thu, 28 Nov 2019 03:04:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbfK1LC0 (ORCPT + 99 others); Thu, 28 Nov 2019 06:02:26 -0500 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:43556 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbfK1LCY (ORCPT ); Thu, 28 Nov 2019 06:02:24 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=shile.zhang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0TjIllLR_1574938929; Received: from e18g09479.et15sqa.tbsite.net(mailfrom:shile.zhang@linux.alibaba.com fp:SMTPD_---0TjIllLR_1574938929) by smtp.aliyun-inc.com(127.0.0.1); Thu, 28 Nov 2019 19:02:15 +0800 From: Shile Zhang To: Peter Zijlstra , Josh Poimboeuf , Masahiro Yamada , Michal Marek , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , x86@kernel.org Cc: "H . Peter Anvin" , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Shile Zhang Subject: [RFC PATCH v5 0/7] Speed booting by sorting ORC unwind tables at build time Date: Thu, 28 Nov 2019 19:01:59 +0800 Message-Id: <20191128110206.2107-1-shile.zhang@linux.alibaba.com> X-Mailer: git-send-email 2.24.0.rc2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series refactored the original sortextable tools, add ORC unwind tables sort at build time. To sort the ORC unwind tables(.orc_unwind & .orc_unwind_ip) can save about 100ms in my test ENV (2C4G VM w/ Xeon 2.5GHz CPU). It costs about 30ms sort by new sorttable tool. Any comments or suggestions are welcome! Thanks! Changelog: ========== v4->v5: - replace sort with qsort, suggested by Andy Lutomirski ; - add error handling in link scripts; - fixed some review findings; v3->v4: - Code refactored for Peter's review findings and suggestions. https://lore.kernel.org/lkml/20191115164539.57930-1-shile.zhang@linux.alibaba.com/ v2->v3: - Discard new added sortorctable tool and related Kconfig changes. - Refactored sortextable, makes it more readable and extendable. - Rename 'sortextable' to 'sorttable', for more kernel tables extend. - Add ORC unwind tables sort into sorttable. - Remove the runtime ORC tables sort. https://lore.kernel.org/lkml/20191115064750.47888-1-shile.zhang@linux.alibaba.com/ v1->v2: - Removed new added Kconfig and runtime sort code, advised by Josh Poimboeuf. - Some minor refactoring. https://lore.kernel.org/lkml/20191108071108.72132-1-shile.zhang@linux.alibaba.com/ v1: - Added a new sortorctable tool to sort ORC unwind tables at build time, same as sortextable. - Add a new Kconfigure to control if ORC unwind tables sort at build time. https://lore.kernel.org/lkml/20191107143205.206606-1-shile.zhang@linux.alibaba.com/ Shile Zhang (7): scripts/sortextable: Rewrite error/success handling scripts/sortextable: kernel coding style formating scripts/sortextable: Remove dead code scripts/sortextable: refactor do_func() function scripts/sorttable: rename sortextable to sorttable scripts/sorttable: Add ORC unwind tables sort concurrently x86/unwind/orc: remove run-time ORC unwind tables sort arch/arc/Kconfig | 2 +- arch/arm/Kconfig | 2 +- arch/arm64/Kconfig | 2 +- arch/microblaze/Kconfig | 2 +- arch/mips/Kconfig | 2 +- arch/parisc/Kconfig | 2 +- arch/powerpc/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/x86/Kconfig | 2 +- arch/x86/kernel/unwind_orc.c | 8 +- arch/xtensa/Kconfig | 2 +- init/Kconfig | 2 +- scripts/.gitignore | 2 +- scripts/Makefile | 10 +- scripts/link-vmlinux.sh | 13 +- scripts/sortextable.h | 209 -------------- scripts/{sortextable.c => sorttable.c} | 299 +++++++++---------- scripts/sorttable.h | 380 +++++++++++++++++++++++++ 18 files changed, 549 insertions(+), 394 deletions(-) delete mode 100644 scripts/sortextable.h rename scripts/{sortextable.c => sorttable.c} (67%) create mode 100644 scripts/sorttable.h -- 2.24.0.rc2