Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2262314lqb; Mon, 27 May 2024 13:30:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWqp+9E0ozBMeMNU+F5sxpBInOp/YKS9i4V7gDcasmsQdPQsn1TmeH/7YdTMgEMD6FgLUAaRj/pqG7yKdeEjksvy4hj8jXxNnWa9Wx9Q== X-Google-Smtp-Source: AGHT+IFM6MzzHVQxZee26XkenfPnHi8tnxnTHfh8F6NI7afr/Op4ww1uUGJy3HpIp9CZChbtIiRY X-Received: by 2002:a17:903:2447:b0:1f4:4617:fc72 with SMTP id d9443c01a7336-1f44872f733mr105843395ad.17.1716841824859; Mon, 27 May 2024 13:30:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716841824; cv=pass; d=google.com; s=arc-20160816; b=Oy+4MJ+P8FYxfGH4nlEBCnpCvu0k0XTQxuZpEYxBB11p4Gb/Vp5XSdkrv4piBBBJrx 10cRYv2wCGDOHiU0mIYeYv0RF5yRfdyOttkmMWAGkOPZVazChOARHLhdduEZxAmD04o8 Iy8CEKhjva5zWjf3TmLtwCSAFpWTKcJNCfVRq8BRMqRtre4jTyTj7uk9sT4I8cDRGLW+ +aygM4XNrD8l+Mu3B9wakUxyKPE3a0unaSNm0VfyW8SY7cooUQvgfLUiGfyN6B6vCTul JfIGw/VkJSReC0ZE2Kxs2JjuvzNGylGZBhVnVOeGEuQaCOFJ0cX+krA2prJnedn9yVfD ++PQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=D601ChQsTU17iMmGHgaVIi72Ruxr/9qmn076K/NhIOM=; fh=avH98sjRBY/UsMOz+FdPyN9KI+oZ6BU7IkEGD4XYz3A=; b=L9YAHYy5o9JvHrUSaLpWkZlRmMuccHnHNzlIdNUIIq+oDmay/F21VzkdsBw6ZqUlEn UQ+tAV8wQt41u/mkbCeKW0BbXLhaS792S6rJyYejVtQ4fLXhxE4BSD7ByzPPO9ZaQOE4 4rbD06gKidXaMBQioenhD8Q4kQbgdAudR94FscEEeJgWx8VIMHqmVz51SinkRT5sVC7W /fY2UIVSmBuuXfuQuYk04d2BTNyTpI9MDK7Tw91725ioGZIxXOI1hawZv9uA2vCs1ylD 2YLB0ey6Rjb+t0Wosb2LICDM7RjI/JF3/mF0ypMWjG2NBKUqfROGBMBTukDQM1YIx+pv tK/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MR+Nw2a1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191389-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bf5fac66ecsi6515766a91.15.2024.05.27.13.30.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 13:30:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191389-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MR+Nw2a1; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191389-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7E3F0283111 for ; Mon, 27 May 2024 20:30:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5FAB1607A1; Mon, 27 May 2024 20:30:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MR+Nw2a1" Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8826B208D1 for ; Mon, 27 May 2024 20:30:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716841818; cv=none; b=PoBmC8tfQpSCLJeeQ/arTGmMF0L/u0/dr3D2aeCwGQ3bqg1T4QdvFVgYZahGWFBQu/ugEONTI34gk2jRx3WHtWCX8HzarX2fy+6Uki9iVGbjeyLJ99EI1l+TyRKlSmKLIAy7/cGEbJiYbaLjElEy9Mp7ljBgZEYtz0PdWgM3FyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716841818; c=relaxed/simple; bh=3OmrorevJpcg2XwjqTWzUYiNQKYSougMWPmDXdlriTo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TaHlsKAnEJsu4JyGUHoWU7XBbGpnXMRa54kTGtGwwlh3XWMu01RsD8hQyyyQUpiRIUMjZUr1p9SYKqRYnIb160ct3iqDXH7o1fXN6ZF4of3fLu4rEyMBduU+I8tUzYdT7jHWmR1TjpZLxEfG65WZC1rE3jandk7pXup+phBIN6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MR+Nw2a1; arc=none smtp.client-ip=209.85.166.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3737b3c6411so96585ab.2 for ; Mon, 27 May 2024 13:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716841816; x=1717446616; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=D601ChQsTU17iMmGHgaVIi72Ruxr/9qmn076K/NhIOM=; b=MR+Nw2a1GA45hcPfIMfhQZlXT9+bhlsNRTahZwVep+fC1vrZpM0svrpvgyyLX7631Y w0Qu1rGG2gT63F20xgal7oAf9jjpiEQ+/mlkymEOhPbBstOQZNVv+7EJRvufZ+/WUV79 qzx7SoJKCGo54X+a99+CywmajYKiHXhReQmo6RZc0C+mzik8P5lm60RVBTP0oPfadOf/ /vpVOr3t2MkKNdqfMvpGgfFahardYdkqWYiv+iKGsbCIU9Fkd8Hv0JxgAwpu1HxAU53P AHwDixnDBMAhOkYGh2BRLyLb3dwpAXtPkjlNZvsSyj0FRjo2lDstDM1CVVNWxylynrql eLkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716841816; x=1717446616; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=D601ChQsTU17iMmGHgaVIi72Ruxr/9qmn076K/NhIOM=; b=BOhqAMMQHfqtCmv/RQiSKHHeSUoOvDSu3Vwwj+VvDEBY1064nSYRoK/w/NNiTbIJNk w+vhK81SEYb6bUDLb0IFmCrKQ6I0LEkkoP775S5Uqa9R9wDjV31xaSB/nZG0OH7OAL9y 5AKsCM6b2F6vAEqzj2cUitLMcb0if+j05bOht8tPaYndh7npuxKuJ1c4vaVOG0udnTZk 4pdBL5iWv5DuXaI4lkFFp6EptiKmWrvCoRRZYQLaXR0bJ/BbosBpTyiUICVCOFtPdTaS dFHh4O3YddOaIsCVQCYG3BzAMWxUQxmpQxgboqfCITqsfaq4bDeWLg82xLkHZ4sCD++w 1YRQ== X-Forwarded-Encrypted: i=1; AJvYcCXNmrTIYPZQVZ+NmoVr4hsXZDwG22eqqiAgi/cvvm9nGBRROl5yz8HQEmCjwqdTFO2w+ZOr+donSkg2vMoaXPBFnMZJoIs4DJPZET2l X-Gm-Message-State: AOJu0Yywc+gnso8U+qiNofICVLcfP/IaFnKNKr1KqJlLMFe1QoEsfeLu iJQJy7xkgjEzvq40lwdgJksxhO4CmUh54/b3FAojgmkYFONqBzdY X-Received: by 2002:a05:6e02:78c:b0:374:5c40:57e with SMTP id e9e14a558f8ab-3745c401203mr23368225ab.0.1716841816544; Mon, 27 May 2024 13:30:16 -0700 (PDT) Received: from visitorckw-System-Product-Name.. ([140.113.216.168]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6822092a678sm5324279a12.11.2024.05.27.13.30.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 13:30:15 -0700 (PDT) From: Kuan-Wei Chiu To: akpm@linux-foundation.org Cc: jserv@ccns.ncku.edu.tw, linux-kernel@vger.kernel.org, Kuan-Wei Chiu Subject: [PATCH 0/4] lib/sort: Optimizations and cleanups Date: Tue, 28 May 2024 04:30:07 +0800 Message-Id: <20240527203011.1644280-1-visitorckw@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Andrew, This patch series optimizes the handling of the last 2 or 3 elements in lib/sort and adds a testcase in lib/test_sort to maintain 100% code coverage reflecting this change. Additionally, it corrects outdated descriptions regarding glibc qsort() and removes the unused pr_fmt macro. Regards, Kuna-Wei Kuan-Wei Chiu (4): lib/sort: Remove unused pr_fmt macro lib/sort: Fix outdated comment regarding glibc qsort() lib/sort: Optimize heapsort for handling final 2 or 3 elements lib/test_sort: Add a testcase to ensure code coverage lib/sort.c | 14 +++++++------- lib/test_sort.c | 14 +++++++++++++- 2 files changed, 20 insertions(+), 8 deletions(-) -- 2.34.1