From patchwork Tue Apr 2 20:52:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Abramov X-Patchwork-Id: 1074953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex.ru Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bvWt4JZk"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b="fenpSTcD"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44YhH23ZZdz9sRs for ; Wed, 3 Apr 2019 07:52:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hOnLL+6CLuJ5TZHGzdeqt4k6rMVP8MtJw616+Fqj7u4=; b=bvWt4JZkiXiBj/ 520FYYhHlX1nkBQA/zg5pleoaO6bAd79hEuLTWYgQqXwW0SAt79JtGmMPtfS8h5fPUb4lNPgavCp/ vPn7rENO864YfY7hC/aqfyMKeKqvId8Ha2f7NjzftPEM96GYWSzGTWrD3XfaTA7xoZDoFVBvaxh5d oKqVaF10sunDaqJByzB1oT3trQ2SNo4U87mHuzRQnUunUXZVy6UKZsGhdGrymo3KtDYkWS6OrMGHs zof3T0VqlKvIJJ6K0k0+czVsRLkH3zL91fPCQiRip0obTEnf6xPBX1+R5K+MR/JtyKUhS2kycmM9l VB5tSVzc7elxDQjj4juA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBQOS-0003fm-5Z; Tue, 02 Apr 2019 20:52:28 +0000 Received: from forward501o.mail.yandex.net ([2a02:6b8:0:1a2d::611]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBQOJ-0003WP-DV; Tue, 02 Apr 2019 20:52:21 +0000 Received: from mxback16o.mail.yandex.net (mxback16o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::67]) by forward501o.mail.yandex.net (Yandex) with ESMTP id A72041E80609; Tue, 2 Apr 2019 23:52:15 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback16o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id T1lxURypq6-qAkWCI5r; Tue, 02 Apr 2019 23:52:14 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554238334; bh=Q4Zr+6SB7d9tkoTBUWJxh8Nzv4LeMGuXGuFdCIzZgWI=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=fenpSTcDtzwNaIjzwh45QitoHHj9y+79AuYmuwkSR5ygs8KWAZvlHlV7QEBNA1fj4 9ihqwg+uBgaGZs2zACPAaSGgbRQSM+obi9CrTLKhR+a1c3B1NC9B92HUQ/BH2tOfM0 S/WWUzhWh+o+bklTTGQghItd1mAYF+i509BmJX5M= Authentication-Results: mxback16o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by iva8-b333b7f98ab0.qloud-c.yandex.net with HTTP; Tue, 02 Apr 2019 23:52:10 +0300 From: Andrey Abramov To: vgupta , benh , paulus , Michael Ellerman , tglx , mingo , bp , hpa , x86 , mark , jlbec , richard , dedekind1 , adrian.hunter , gregkh , naveen.n.rao , jpoimboe , Dave Chinner , darrick.wong , ard.biesheuvel , George Spelvin , linux-snps-arc , Linux Kernel Mailing List , linuxppc-dev , ocfs2-devel , linux-mtd , sfr In-Reply-To: <824481554237711@sas1-23a37bc8251c.qloud-c.yandex.net> References: <824481554237711@sas1-23a37bc8251c.qloud-c.yandex.net> Subject: [PATCH v3 4/5] ubifs: find.c: replace swap function with built-in one MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 02 Apr 2019 23:52:10 +0300 Message-Id: <1002111554238330@iva8-b333b7f98ab0.qloud-c.yandex.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190402_135219_824161_F6EA437F X-CRM114-Status: UNSURE ( 7.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a02:6b8:0:1a2d:0:0:0:611 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (st5pub[at]yandex.ru) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gustavo Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Replace swap_dirty_idx function with built-in one, because swap_dirty_idx does only a simple byte to byte swap. Since Spectre mitigations have made indirect function calls more expensive, and the default simple byte copies swap is implemented without them, an "optimized" custom swap function is now a waste of time as well as code. Signed-off-by: Andrey Abramov Reviewed by: George Spelvin --- v2->v3: nothing changed fs/ubifs/find.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index f9646835b026..5deaae7fcead 100644 --- a/fs/ubifs/find.c +++ b/fs/ubifs/find.c @@ -747,12 +747,6 @@ static int cmp_dirty_idx(const struct ubifs_lprops **a, return lpa->dirty + lpa->free - lpb->dirty - lpb->free; } -static void swap_dirty_idx(struct ubifs_lprops **a, struct ubifs_lprops **b, - int size) -{ - swap(*a, *b); -} - /** * ubifs_save_dirty_idx_lnums - save an array of the most dirty index LEB nos. * @c: the UBIFS file-system description object @@ -772,8 +766,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c) sizeof(void *) * c->dirty_idx.cnt); /* Sort it so that the dirtiest is now at the end */ sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *), - (int (*)(const void *, const void *))cmp_dirty_idx, - (void (*)(void *, void *, int))swap_dirty_idx); + (int (*)(const void *, const void *))cmp_dirty_idx, NULL); dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt); if (c->dirty_idx.cnt) dbg_find("dirtiest index LEB is %d with dirty %d and free %d",