From patchwork Fri Jan 28 03:25:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Koba Ko X-Patchwork-Id: 1585432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=PFcBg/dC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JlNCs4RS4z9tT8 for ; Fri, 28 Jan 2022 14:26:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nDHu3-000107-0s; Fri, 28 Jan 2022 03:26:23 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nDHu0-0000yY-Fe for kernel-team@lists.ubuntu.com; Fri, 28 Jan 2022 03:26:20 +0000 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 36DFE3F1D8 for ; Fri, 28 Jan 2022 03:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1643340380; bh=kVAqxVTCtXNQh5jplCjYRtR5aW7EjJAJ9gr4jT2ZhTk=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PFcBg/dCtJpEN+K/ShQS8U6kcacPuAvW+ZF5nMb39xfdkmQ+gd+v6sLE1DnXiMe6d Y3hLMznOurT4kBhBAKg6aPnnfoFmnzeFe+4s9paL01BvqIT+2b8PbT6HeygU6YX4EA xcdAB8/KOA0EZa693gYp5I+/DHUWv4s6Vw14FeuPvkk97WOhG4QIT7AVT2ur/s0VAc mPZxQuAiPQhF6/8rv43dbG+M2wLd8GxV0o1+H/mD4HkCMUJeR3oaTt3P/LfTWeSKPs aNSZxVeM7w6jA3v6Zlu3ivWUR+yvJYsImqPskcVNp30r0/t4agqiCumgKwpwb93ygq tuYyM8uJzsPuQ== Received: by mail-pl1-f199.google.com with SMTP id h9-20020a170902680900b0014adffcba60so2506695plk.7 for ; Thu, 27 Jan 2022 19:26:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kVAqxVTCtXNQh5jplCjYRtR5aW7EjJAJ9gr4jT2ZhTk=; b=sGw55bMekg+kr0qe59DlrzgYiKTTkE21ZU4UmRoZ+0Gk4lv3A/QJEnsi43XrY0qPtg KDkeclLwdLa8/FMs78xVVt9FRI59Lg4uAB87+eKl4IFApTL5GuTWiiNkUHznOgBDDMjB tewtIfBOhQ7h3+YdgP26sfv11iALe6Nu5Ppyhmw8mpVdH+0/htBj1g1pSMLFT0fIFzwq L7oLYewAJXeQY6BxNYgYKTsB2zGWRpZY+HjbAHI09JKTuzj8F9obaaGcRrLa7PgOgLNs WOtk9twGm5u9Tho5kBe+f4yx5D2RYnOkBPSMiSDxHA04Nc4FsMm4+VvHhgbNqSWCqjJP IVHg== X-Gm-Message-State: AOAM530x1xmuSpDVAOuQ37U137J4nOWPg72kdTLYktvWSTUT+4KQ+Z5v NsuBep7UckVY4tUrXpkMmnD5HorDTIoxSZ12zXa3449kqY3u1NDBZaFB1ViiE9H8oxve+WPPpRs l2KCXAyO84q70e0y7z8pzas8HQpn5Zt9sqECEZrrH3A== X-Received: by 2002:a17:902:a512:: with SMTP id s18mr6632878plq.51.1643340378711; Thu, 27 Jan 2022 19:26:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlPq1sdFR4lauoVv2/pIqBYiCozALIc99ymIrHuBpztQxmn/B26Xl8/aR0qHYUnoxZA5mljQ== X-Received: by 2002:a17:902:a512:: with SMTP id s18mr6632854plq.51.1643340378330; Thu, 27 Jan 2022 19:26:18 -0800 (PST) Received: from canonical.com (211-75-139-218.hinet-ip.hinet.net. [211.75.139.218]) by smtp.gmail.com with ESMTPSA id s8sm6637978pfw.158.2022.01.27.19.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 19:26:18 -0800 (PST) From: Koba Ko To: kernel-team@lists.ubuntu.com Subject: [PATCH 03/23][SRU][OEM-5.14] block: pass a gendisk to blk_queue_update_readahead Date: Fri, 28 Jan 2022 11:25:50 +0800 Message-Id: <20220128032610.392273-4-koba.ko@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220128032610.392273-1-koba.ko@canonical.com> References: <20220128032610.392273-1-koba.ko@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Christoph Hellwig BugLink: https://bugs.launchpad.net/bugs/1958850 .. and rename the function to disk_update_readahead. This is in preparation for moving the BDI from the request_queue to the gendisk. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20210809141744.1203023-3-hch@lst.de Signed-off-by: Jens Axboe (cherry picked from commit 471aa704db4904f7af5a50019ca3b5b018c0cf62) Signed-off-by: Koba Ko --- block/blk-settings.c | 8 +++++--- block/blk-sysfs.c | 2 +- drivers/block/drbd/drbd_nl.c | 2 +- drivers/md/dm-table.c | 2 +- drivers/nvme/host/core.c | 2 +- include/linux/blkdev.h | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/block/blk-settings.c b/block/blk-settings.c index 4c7c0c17cb0a3..8ee2682a3e6d4 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -380,8 +380,10 @@ void blk_queue_alignment_offset(struct request_queue *q, unsigned int offset) } EXPORT_SYMBOL(blk_queue_alignment_offset); -void blk_queue_update_readahead(struct request_queue *q) +void disk_update_readahead(struct gendisk *disk) { + struct request_queue *q = disk->queue; + /* * For read-ahead of large files to be effective, we need to read ahead * at least twice the optimal I/O size. @@ -391,7 +393,7 @@ void blk_queue_update_readahead(struct request_queue *q) q->backing_dev_info->io_pages = queue_max_sectors(q) >> (PAGE_SHIFT - 9); } -EXPORT_SYMBOL_GPL(blk_queue_update_readahead); +EXPORT_SYMBOL_GPL(disk_update_readahead); /** * blk_limits_io_min - set minimum request size for a device @@ -671,7 +673,7 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, top, bottom); } - blk_queue_update_readahead(disk->queue); + disk_update_readahead(disk); } EXPORT_SYMBOL(disk_stack_limits); diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index ccea82de4554b..4f834bf93e20b 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -856,7 +856,7 @@ int blk_register_queue(struct gendisk *disk) "%s is registering an already registered queue\n", kobject_name(&dev->kobj)); - blk_queue_update_readahead(q); + disk_update_readahead(disk); ret = blk_trace_init_sysfs(dev); if (ret) diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index e7d0e637e6321..44ccf8b4f4b29 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1364,7 +1364,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi if (b) { blk_stack_limits(&q->limits, &b->limits, 0); - blk_queue_update_readahead(q); + disk_update_readahead(device->vdisk); } fixup_discard_if_not_supported(q); fixup_write_zeroes(device, q); diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 0543cdf89e929..b03eabc1ed7cb 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -2076,7 +2076,7 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, } dm_update_keyslot_manager(q, t); - blk_queue_update_readahead(q); + disk_update_readahead(t->md->disk); return 0; } diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 9b6f78eac9375..3553ba5c93f89 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1892,7 +1892,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id) nvme_update_disk_info(ns->head->disk, ns, id); blk_stack_limits(&ns->head->disk->queue->limits, &ns->queue->limits, 0); - blk_queue_update_readahead(ns->head->disk->queue); + disk_update_readahead(ns->head->disk); blk_mq_unfreeze_queue(ns->head->disk->queue); } return 0; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 42ed8ccc40e77..d95fee696627a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1147,7 +1147,7 @@ void blk_queue_zone_write_granularity(struct request_queue *q, unsigned int size); extern void blk_queue_alignment_offset(struct request_queue *q, unsigned int alignment); -void blk_queue_update_readahead(struct request_queue *q); +void disk_update_readahead(struct gendisk *disk); extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); extern void blk_queue_io_min(struct request_queue *q, unsigned int min); extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);