Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3848657ybx; Mon, 4 Nov 2019 03:56:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwq5tIs9yiKpTmJpHOMP9IzH3V9GH3opBcYeii4gugxNRmp8bGE3rPEU/uQ3vI6jym7DsOT X-Received: by 2002:a17:906:2a89:: with SMTP id l9mr23555071eje.329.1572868606360; Mon, 04 Nov 2019 03:56:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1572868606; cv=pass; d=google.com; s=arc-20160816; b=c7b4UXGw/u8olz6xKBkH+opeMn95VKx4D1mrdJ6FXXjC5ng50gWEbY34OsQ/BrS9Qe u8a2iQzjm9MV+zPU1j5bNpJvT97Dq2H8tAsEaxLSsThMTWAfcx8YMWyeItidfr5TBwau 3cjYG95z4pvFb22v6V6RgOEa/a3OPM5jPyrsDMjK8o1UgZrxOu2SqxvIHcYVJ9K/AG9c G3L341+odCDEUi5jMqMSWGC/caCCOqgzXh10JOUFfaE3KJbsvbXY2gXAMejbZ6gpEtP6 wJ6Xq+MS/Cqxe357t9x63RWG1oMxrgH/qbOyYVhRUz8YUx25OyLDHHZ6xHC4sRipRetj 3Smg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=LcQzffD0A2m7LCciRN8lyQm615vt2s14ntIlVKAf5zA=; b=gLbXzcZ5q+y8OjxnNZyFznPWT0SYNexuZVF0u+/QWPDFjn/Fo1j+yVZF9jdAWDgRnP axSzn9DaVng+9fjC4IqWgygJokom8yeAQbJUmNSxA+LOKgWAkXlwnj30t10W8aFL/Giw HKasbFs6Y825fegmyor1f164i+mLIkxw2+lkDweVgtBRrQ+LsOLLWS5roLeiVEbyrJwR FLG71WtfYR3rDuzevE6FA/TahwP18CRXytZvYuUJEZ40Low/cTIN1dSz5/FSqDvQeP8v bAvRF7AjCcJZLGBfb692VbOk3LFZP2d4kMjWrwpeUbqpohAiP1biVxaJb6Jarj9+F5vP CXSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=YdZHKJSJ; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si7061455edd.294.2019.11.04.03.56.15; Mon, 04 Nov 2019 03:56:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b=YdZHKJSJ; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728843AbfKDL4M (ORCPT + 99 others); Mon, 4 Nov 2019 06:56:12 -0500 Received: from sender3-of-o52.zoho.com.cn ([124.251.121.247]:21984 "EHLO sender2.zoho.com.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728827AbfKDL4M (ORCPT ); Mon, 4 Nov 2019 06:56:12 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1572867662; cv=none; d=zoho.com.cn; s=zohoarc; b=G8ajjM/9vPkVyno6masR4w8XKJNd0qlXdvNBd1P4UWsyM5poeGOQeYko5u+ooNDGiH+G7ziT0UbjeipFVSOuYJrQkXqYOLCe6/UfgH9VLG8ZnnwsxvhwKvyWlBaakKpH45rlD04iRfq5jX3tmkZu+xl7ybGwOgICfuzvtNlWg4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1572867662; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=LcQzffD0A2m7LCciRN8lyQm615vt2s14ntIlVKAf5zA=; b=PiuPqrqqGeyuOv5I2t1MQAITGwLk3b55LFeEqSzIZEJ21dOadhxMlg1biEFr7SMsjxleys2gPwOgMz6wLN6crjGlWcmjRRukRxpdppBvnGXV04/DfOMecIjtJzei0cfuNSh3jHcjXHIUKccrjwNkzaWVHkXBwuztM8HgHSEtYLA= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1572867662; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; l=913; bh=LcQzffD0A2m7LCciRN8lyQm615vt2s14ntIlVKAf5zA=; b=YdZHKJSJJVhhqwiumc+1t9v0leVkEx8k9yacdyCClBH8OS0K5FYie1pEtZpDd9XS Lpt5SNTmBLcSWcw+pOUxuZPA+z1e0GB/w1Q1130ENj+Q5/kkgLsdt1qhgtsnVC7LiiI tjI9ANefV9O5Uz+np2+vr+BL39RAjS7QIrRXbbWc= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1572867661068351.7134233309414; Mon, 4 Nov 2019 19:41:01 +0800 (CST) From: Chengguang Xu To: jack@suse.com Cc: linux-ext4@vger.kernel.org, Chengguang Xu Message-ID: <20191104114036.9893-3-cgxu519@mykernel.net> Subject: [PATCH 3/5] ext2: skip unnecessary operations in ext2_try_to_allocate() Date: Mon, 4 Nov 2019 19:40:34 +0800 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191104114036.9893-1-cgxu519@mykernel.net> References: <20191104114036.9893-1-cgxu519@mykernel.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Move 'repeat' tag to proper place so that we can skip unnecessary operations in ext2_try_to_allocate(). Signed-off-by: Chengguang Xu --- fs/ext2/balloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index 994a1fd18e93..a0c22e166682 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -696,7 +696,6 @@ ext2_try_to_allocate(struct super_block *sb, int group, =20 =09BUG_ON(start > EXT2_BLOCKS_PER_GROUP(sb)); =20 -repeat: =09if (grp_goal < 0) { =09=09grp_goal =3D find_next_usable_block(start, bitmap_bh, end); =09=09if (grp_goal < 0) @@ -713,6 +712,7 @@ ext2_try_to_allocate(struct super_block *sb, int group, =09} =09start =3D grp_goal; =20 +repeat: =09if (ext2_set_bit_atomic(sb_bgl_lock(EXT2_SB(sb), group), grp_goal, =09=09=09 =09=09=09=09bitmap_bh->b_data)) { =09=09/* --=20 2.20.1