From patchwork Wed Mar 22 13:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 13184072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F5EEC6FD1C for ; Wed, 22 Mar 2023 13:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230509AbjCVNuy (ORCPT ); Wed, 22 Mar 2023 09:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbjCVNup (ORCPT ); Wed, 22 Mar 2023 09:50:45 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F7B637E6 for ; Wed, 22 Mar 2023 06:50:22 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20230322135017euoutp02fc54f8a8c60ce0a91e5ea4c1198af102~OwgBeOZTA1714617146euoutp026 for ; Wed, 22 Mar 2023 13:50:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20230322135017euoutp02fc54f8a8c60ce0a91e5ea4c1198af102~OwgBeOZTA1714617146euoutp026 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1679493017; bh=ayJOnQy0cJGhVp2X4oA4O9yHIEvSlM4NjOeswQrRlbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jxLxuMv8Fbh+flqd2wfT4DFjYUWiYF+pAGZG9jq1MkD34NB7EFUWc69IwJhVM8BCY Cije3dHiyaTah0viBkegX6iXobpP9SoDCR/sAOgdWL3qRZkb2osNgxPr76u1Cm7yv5 upYfW+rPBqS1isBzkPhwoeVQo9mPdo3Cv7ETQCjA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230322135016eucas1p25117e603c54a51fa479f59756c985bea~Owf-8x0Je2739227392eucas1p2l; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 7E.84.09503.8970B146; Wed, 22 Mar 2023 13:50:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090~Owf-hW9Mr1936419364eucas1p1R; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230322135015eusmtrp27e8edde4a243950d6e8a8590cf408615~Owf-ghEWR0726007260eusmtrp2D; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) X-AuditID: cbfec7f2-e8fff7000000251f-e0-641b0798d498 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 99.6E.09583.7970B146; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) Received: from localhost (unknown [106.210.248.108]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230322135015eusmtip26a172e30dde79a8b20bac498b7926a53~Owf-T0JHc1265312653eusmtip2f; Wed, 22 Mar 2023 13:50:15 +0000 (GMT) From: Pankaj Raghav To: senozhatsky@chromium.org, viro@zeniv.linux.org.uk, axboe@kernel.dk, willy@infradead.org, brauner@kernel.org, akpm@linux-foundation.org, minchan@kernel.org, hubcap@omnibond.com, martin@omnibond.com Cc: mcgrof@kernel.org, devel@lists.orangefs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [RFC v2 1/5] zram: remove zram_page_end_io function Date: Wed, 22 Mar 2023 14:50:09 +0100 Message-Id: <20230322135013.197076-2-p.raghav@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230322135013.197076-1-p.raghav@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBKsWRmVeSWpSXmKPExsWy7djPc7oz2KVTDCZt57GYs34Nm8Xqu/1s Fq8Pf2K02L95CpPFzQM7mSza7/YxWey9pW2xZ+9JFovLu+awWdxb85/V4uT6/8wWNyY8ZbRY 9vU9u8XnpS3sFrs3LmKzOP/3OKvF7x9z2BwEPWY3XGTx2LxCy+Py2VKPTas62Tw2fZrE7nFi xm8Wj4apt9g8ft2+w+rRt2UVo8fnTXIem568ZQrgjuKySUnNySxLLdK3S+DKOLrzD2vBFq6K P5cMGxjPcHQxcnBICJhITD4u3MXIxSEksIJR4tq9X0wQzhdGic9HrjBCOJ8ZJY6+uMrSxcgJ 1vF30kJmiMRyRokZb59CVb1klFh3fjsryFw2AS2Jxk52kLiIwBlGiSlNMxhBupkF7jNKnN4L NklYwEZi17OJ7CA2i4CqxNb2p2BxXgEriYd/u9ghtslL7D94lhnE5hSwlni0aBobRI2gxMmZ T1ggZspLNG+dzQxRv5pT4vJPNwjbRaKj4zMrhC0s8er4FqiZMhL/d85ngrCrJZ7e+A32jYRA C6NE/871bJCAsZboO5MDYjILaEqs36UPEXWU2LpSB8Lkk7jxVhDiAD6JSdumM0OEeSU62oQg ZitJ7Pz5BGqnhMTlpjlA97ID2R4SnaoTGBVnIXlkFpJHZiEsXcDIvIpRPLW0ODc9tdgwL7Vc rzgxt7g0L10vOT93EyMw8Z3+d/zTDsa5rz7qHWJk4mA8xCjBwawkwuvGLJEixJuS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Fe++qh3iJGJg/EQowQHs5IIrxuzRIoQb0pi ZVVqUX58UWlOavEhRlOguycyS4km5wPTRV5JvKGZgamhiZmlgamlmbGSOK9nQUeikEB6Yklq dmpqQWoRTB8TB6dUAxPbn39uX3UDP0/cNsl0f2OOVGjumYzJU78I87p8dtJd/ufstAPqPTP6 WWU948/0THqW+1TZeMeFJW8t7wdELhS+wFOo2m+64ax2lC/HZ+EA9uBpT/bUrfrtaH3rRswP h63i7zZqG2S1il3Zddwtz+XZ9+mH98Y5/Jhx/ZXBlLqorbVxUwtMHoXd1P4VZBsRI3v0pxXL 4xTW+K5F53gCs+Y0BH/4vWDvGRnGukuP+A/s4lplmSEt7S+kEjG1Lfa8+Y2T6SyzOMSEF65d uOBbi+eBmqq5rT5GefqHZ80K79i469bZ+0r/uS/4nr9z4JbH7xSB6z+Tf1lMqr2z38zsK6Pc 81/r9khvuio35/rLAt1LSizFGYmGWsxFxYkAUAi+E18DAAA= X-CMS-MailID: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 X-Msg-Generator: CA X-RootMTR: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090 References: <20230322135013.197076-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org zram_page_end_io function is called when alloc_page is used (for partial IO) to trigger writeback from the user space. The pages used for this operation is never locked or have the writeback set. So, it is safe to remove zram_page_end_io function that unlocks or marks writeback end on the page. Signed-off-by: Pankaj Raghav --- drivers/block/zram/zram_drv.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index b7bb52f8dfbd..2341f4009b0f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -606,15 +606,6 @@ static void free_block_bdev(struct zram *zram, unsigned long blk_idx) atomic64_dec(&zram->stats.bd_count); } -static void zram_page_end_io(struct bio *bio) -{ - struct page *page = bio_first_page_all(bio); - - page_endio(page, op_is_write(bio_op(bio)), - blk_status_to_errno(bio->bi_status)); - bio_put(bio); -} - /* * Returns 1 if the submission is successful. */ @@ -634,9 +625,7 @@ static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, return -EIO; } - if (!parent) - bio->bi_end_io = zram_page_end_io; - else + if (parent) bio_chain(bio, parent); submit_bio(bio);