From patchwork Sat Jan 27 02:35:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533944 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3406EB65C for ; Sat, 27 Jan 2024 02:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; cv=none; b=pk3LbB45rbGLMk3OGlIcYNV7dSYThu64GIWz6Met5J+VYzZ+aNsCn6Im2ipyFkGB4fGpn7cW4Qml7GUDtjsKrsOa61Yp7uKKjfF97UmM0n/LR8VqDluiwX4/DNytkUnSKt+yiCK58VNxu3aurfJjet8Fncb7Lq5qZzravyi4N4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; c=relaxed/simple; bh=7+16x9S2keM3gIhEh6E7x2bFKGS6K7PhrevswNenfgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WaCRGl3lBN3Rz1D56FCl1V5wmvwbBO/yp3PxaqAVVney9fuLpdz0n3W3tPASrVXuRfKp1CuUxuFcf/kkzuG0EnEgXOOy9iAyvpFeNup2kB5MWg8QCBtKMcLCW7zynBz89vd94tACpO7akaPtdEUFEO2ulsPqjB/b/AZoNC/1Eas= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cwCbkJxP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cwCbkJxP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706322953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6r2qehB/ngNMLkkPh0sJKGMbg6Db5fJinTPw9GaJaEY=; b=cwCbkJxPeDZqIBb723ZvVo5MZLqwrEDEH5WOFZb5tnVFbTFqlU4pGzOKPcjhdd+vLbvXeu lTTE/E1VNcAJYuhQFLRbCt3b5XRyCFkh18lbEJyJonOWcFhzuU/G7XQuI0ZCG27qoB2imy NbJJgu9D/0zNhnwGsTqmsSDPRZK2LRU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-aWBocmNdNum2wZ0bmAYYsg-1; Fri, 26 Jan 2024 21:35:49 -0500 X-MC-Unique: aWBocmNdNum2wZ0bmAYYsg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FA6C837226; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 599AC1C060B1; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 4D1BE560C1; Fri, 26 Jan 2024 21:35:49 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 1/5] dm vdo block-map: fix a few small nits Date: Fri, 26 Jan 2024 21:35:45 -0500 Message-ID: In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer Rename 'pages' to 'num_pages' in distribute_page_over_waitq(). Update assert message in validate_completed_page() to model others. Tweak line-wrapping on a comment that was needlessly long. Signed-off-by: Mike Snitzer Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/block-map.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index f9f68e8d4b0c..64f893b0721a 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -535,19 +535,19 @@ static void complete_waiter_with_page(struct vdo_waiter *waiter, void *page_info static unsigned int distribute_page_over_waitq(struct page_info *info, struct vdo_wait_queue *waitq) { - size_t pages; + size_t num_pages; update_lru(info); - pages = vdo_waitq_num_waiters(waitq); + num_pages = vdo_waitq_num_waiters(waitq); /* * Increment the busy count once for each pending completion so that this page does not * stop being busy until all completions have been processed (VDO-83). */ - info->busy += pages; + info->busy += num_pages; vdo_waitq_notify_all_waiters(waitq, complete_waiter_with_page, info); - return pages; + return num_pages; } /** @@ -614,7 +614,8 @@ static int __must_check validate_completed_page(struct vdo_page_completion *comp return result; if (writable) { - result = ASSERT(completion->writable, "VDO Page Completion is writable"); + result = ASSERT(completion->writable, + "VDO Page Completion must be writable"); if (result != UDS_SUCCESS) return result; } @@ -741,8 +742,8 @@ static void handle_rebuild_read_error(struct vdo_completion *completion) assert_on_cache_thread(cache, __func__); /* - * We are doing a read-only rebuild, so treat this as a successful read of an uninitialized - * page. + * We are doing a read-only rebuild, so treat this as a successful read + * of an uninitialized page. */ vio_record_metadata_io_error(as_vio(completion)); ADD_ONCE(cache->stats.failed_reads, 1); From patchwork Sat Jan 27 02:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533943 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3853FB664 for ; Sat, 27 Jan 2024 02:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; cv=none; b=J31smxH2IC1OBwRnmviHJu5gZYD0JjB2qgC34ZylvdS+hIv4GSOAfnaaeD+Rc1jiOEPC0HEc+biz48HCLlZ6qiCk4bmArHxeE2XDECXMG3H3vaHWrm8YFZG0kyCaqCHpq/3mRvpoUmihFsZf97M94DILbgH0Itul3QcLNtbFD/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; c=relaxed/simple; bh=KaoRTRL5C6livYGuEfVDIBJkVrkspJon714E3ykOBOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c2xZUksNfoz0hFk+Q1wcfen9wRyMzb6POQOcHd+FeWbgmQ67PpdjZVpyPCuifSpuft6Qp32qQxjphObY9LsemgiPxKln7yh+rf+GI/M/NKkkg8G4MselGm+9ZtJrEgtkr48MftCkmSj7MTkfB+Vw/4OzIFgiqFThT4BOcuY3Y5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H09HM9M1; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H09HM9M1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706322953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8oo3PRljewoyVY8oguPkv3E6tkhMZMTMVQ4p8SMLD9g=; b=H09HM9M1XiX6U08BcNhxBe4/4RlRcAMhzZyGI4nkUzlgh4vHFZ1PR1YXb/4c58JI3gQSnQ d4BRUQIJlCspdNv21AjSaKMe8/9IiC/lLPwxW/jud6f/OnWV0zJN1/Yr4YXVAGrqNGBrI0 bmg9b45YeGQ8cj5srlY8GjyHA/Ivcfc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-232-Vjn1-xG6P8CH4mwqAsMr2Q-1; Fri, 26 Jan 2024 21:35:49 -0500 X-MC-Unique: Vjn1-xG6P8CH4mwqAsMr2Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5EC463806282; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 596235012; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 53B9F560C3; Fri, 26 Jan 2024 21:35:49 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 2/5] dm vdo block-map: use uds_log_ratelimit() rather than open code it Date: Fri, 26 Jan 2024 21:35:46 -0500 Message-ID: <96709a3b8f228f826897fd9b5d0ce4c3c0dcb058.1706322049.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer Signed-off-by: Mike Snitzer Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/block-map.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index 64f893b0721a..eb838e6ae3e6 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -1014,13 +1014,9 @@ static void handle_page_write_error(struct vdo_completion *completion) /* If we're already read-only, write failures are to be expected. */ if (result != VDO_READ_ONLY) { - static DEFINE_RATELIMIT_STATE(error_limiter, DEFAULT_RATELIMIT_INTERVAL, - DEFAULT_RATELIMIT_BURST); - - if (__ratelimit(&error_limiter)) { - uds_log_error("failed to write block map page %llu", - (unsigned long long) info->pbn); - } + uds_log_ratelimit(uds_log_error, + "failed to write block map page %llu", + (unsigned long long) info->pbn); } set_info_state(info, PS_DIRTY); From patchwork Sat Jan 27 02:35:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533941 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B7F065C for ; Sat, 27 Jan 2024 02:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322954; cv=none; b=E+VvPqRfGDBEVhVr17P8hryRXUFCeJG9tCYrmir9uvUHKAnFbuSg2UbQOfpx+i2bbuWDzTRO3qdF7bDSxR9ryNY2LqEhchBS4mjMIjjGMdiiAF5QNoexbwoPkD3X+BV+t70FdxbGPzZ440+kvkPnkUvz/A0U5pIGNJXF9wwPNVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322954; c=relaxed/simple; bh=HrStFWzjn0phHu7TW6gLnml9OHSKiAJ4ZGe+7RJDwqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=q9haleZgkwgYwLWr/oreK+rKAbVjjXwxSsc7PdO4mX+MLpYH5FjRmYh5IE+t2ICzMnFygZLW17VZUk48Uvb4PRTCzK2DywxaKF5p9Ph0snERm91LL9WOjEl0E9uBx49aLvEqKr+m2e9Xssb/vUSE8/BAy/KHZkC6KelNY2VKGBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ddqqaIGM; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ddqqaIGM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706322951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FwordXpELz2O9MVOgDXVigGHpQ8FCY5j6wtLbNNXjc4=; b=ddqqaIGMxELrrD2kD6ybMlhWgYcBolkIt3bM45T8BZGU5mOVf4c9TTbOguRWFi/iicwqFa EujfSes9P0qmv6tKjvDjefKhekzHKqPZErBkSF4hnXVjtged0niTDFJfCNor2TleEiaqOq QESqvsC0Rm8+/JtEa+z80PzjtAc1zls= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-166-gHP7944DNSKqmX3JFBmn8g-1; Fri, 26 Jan 2024 21:35:49 -0500 X-MC-Unique: gHP7944DNSKqmX3JFBmn8g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 776D5827D8D; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60846203C981; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 59906560C5; Fri, 26 Jan 2024 21:35:49 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 3/5] dm vdo block-map: remove extra vdo arg from initialize_block_map_zone Date: Fri, 26 Jan 2024 21:35:47 -0500 Message-ID: <8feda8993a1720e4b8dd577ce875bf466e8ca020.1706322049.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer The block_map is passed to initialize_block_map_zone, but the block_map's vdo member is already initialized with the same vdo instance, so just use it. Signed-off-by: Mike Snitzer Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/block-map.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index eb838e6ae3e6..eda42383a2c1 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -2719,12 +2719,12 @@ void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, */ static int __must_check initialize_block_map_zone(struct block_map *map, zone_count_t zone_number, - struct vdo *vdo, page_count_t cache_size, block_count_t maximum_age) { int result; block_count_t i; + struct vdo *vdo = map->vdo; struct block_map_zone *zone = &map->zones[zone_number]; BUILD_BUG_ON(sizeof(struct page_descriptor) != sizeof(u64)); @@ -2898,8 +2898,7 @@ int vdo_decode_block_map(struct block_map_state_2_0 state, block_count_t logical map->zone_count = vdo->thread_config.logical_zone_count; for (zone = 0; zone < map->zone_count; zone++) { - result = initialize_block_map_zone(map, zone, vdo, cache_size, - maximum_age); + result = initialize_block_map_zone(map, zone, cache_size, maximum_age); if (result != VDO_SUCCESS) { vdo_free_block_map(map); return result; From patchwork Sat Jan 27 02:35:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533946 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 340359475 for ; Sat, 27 Jan 2024 02:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; cv=none; b=KqMTG8YA6Pkpr3bUJnCyJe4xakC3h66LpOo4oYUEAutXtU3UQKGDKQLHeF74bwRwqbgF+BF/APXxLC0yoBIgxPCUZljryun1LVwg/+nzaoaFF6Q0lrUjVToxR8v1RzNsBhu4AIDXIF0iGJHCjJ+aGzT8MO8NbM5YGaH5Z4QhXh0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; c=relaxed/simple; bh=OH3ve7NjkQj9p6qNtHcEMba1LUh3XjamBSno+bR35xs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pPUwoY3bNCXtgID2+mJgzYOSttk/SKwC2Gd21cS72AmRzJqL/DEGR6QNTCZYOyzGBWENtW/j8Ww91kpEHRPRULlKpTMqkRdnYG/5tdMFpXrLCBW+u1le4363kDxJOpdUmMc96bl/5GrJz2hN7ykW024yUzyZertEkUcShMBjBhM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RIzjB34l; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RIzjB34l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706322953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NzzGLrD8hQckS8ozwHpH7C97fefB70tFTutgnlboENg=; b=RIzjB34ltm6ZIRx0467XvH9m6pSkLjLgrDLjqLaIa4UOgH4J1sBU2v2HIeoLbelWT/Q7rR OBOqe94px9zaaBLgATmztAb1DACyrz/oSZZGcmDhzRaZIJTPzAOQ+qXPqo9e15oY/29Vhk ka3Kht/871gEzko4YNybiDqsb/1yly4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-459-2JqvhwU3MhyCRw57nUEZmg-1; Fri, 26 Jan 2024 21:35:49 -0500 X-MC-Unique: 2JqvhwU3MhyCRw57nUEZmg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68508827D8C; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62BB0492BE3; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 5F6C3560C7; Fri, 26 Jan 2024 21:35:49 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 4/5] dm vdo block-map: avoid extra dereferences to access vdo object Date: Fri, 26 Jan 2024 21:35:48 -0500 Message-ID: <5ccfb6d5622877f57b5f8329a42e7aaad7d9a997.1706322049.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer The vdo_page_cache's 'vdo' is the same as the block_map's vdo instance, so use that to save 2 extra dereferences. Signed-off-by: Mike Snitzer Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/block-map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index eda42383a2c1..0ce136612869 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -562,7 +562,7 @@ static void set_persistent_error(struct vdo_page_cache *cache, const char *conte { struct page_info *info; /* If we're already read-only, there's no need to log. */ - struct vdo *vdo = cache->zone->block_map->vdo; + struct vdo *vdo = cache->vdo; if ((result != VDO_READ_ONLY) && !vdo_is_read_only(vdo)) { uds_log_error_strerror(result, "VDO Page Cache persistent error: %s", @@ -1111,7 +1111,7 @@ static void write_pages(struct vdo_completion *flush_completion) state_entry); list_del_init(&info->state_entry); - if (vdo_is_read_only(info->cache->zone->block_map->vdo)) { + if (vdo_is_read_only(info->cache->vdo)) { struct vdo_completion *completion = &info->vio->completion; vdo_reset_completion(completion); @@ -1233,7 +1233,7 @@ void vdo_get_page(struct vdo_page_completion *page_completion, cache->zone->thread_id, parent); completion->requeue = requeue; - if (page_completion->writable && vdo_is_read_only(cache->zone->block_map->vdo)) { + if (page_completion->writable && vdo_is_read_only(cache->vdo)) { vdo_fail_completion(completion, VDO_READ_ONLY); return; } From patchwork Sat Jan 27 02:35:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Sakai X-Patchwork-Id: 13533945 X-Patchwork-Delegate: snitzer@redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D36C33EE for ; Sat, 27 Jan 2024 02:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; cv=none; b=H25byGVz/mhsvmHRR6wE5InA+oK+InITbpKTmYE2tPIB8DXaFZ+wCPITaFIXcZwtUGP8vQRroapqYxU9IvsEdxh07bzqee2Jo06YJy4ZrYsZ1DF8PkioiXWdJ1j3aq0laMRz0jedCq71HA84RDUW61oVOBm87v9sHuvo9c4EvPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706322955; c=relaxed/simple; bh=/LwGdOSjHMwSKkZwHxRLc2bV51QnBRPw/hUS43e2VEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KJjCroNSgLrB4r6OOq04M4HnIY3SUXMQlj9BoQgJZgIuPKDsHbWUips/RUWZcpKOKIeddAIo0fL10haNU6Nuwh6ocaovyG2YCZbfpmsUVgnc+5hmnYOWVddJr6zdkXXjGGN/Kq9haTceoZjLTrmqz3eml5iUN5HwR2ZlNRcuR3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ccCS+grv; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ccCS+grv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706322953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w6lYxBgzEZRfE3DJpDSDNt+V4cAHJC9ou/tD0bVvlN0=; b=ccCS+grvQp7Rzc6WqeKbgcjWfCxaDc5s0xxA/nqiw1vSygfPLV9Aar36aqRR4/5wVGjBqq KLFPp1Lc8s61LPsNd0+/gR1CraTXWZqBXUS/QxBF9/r71ei8SO3CvTEGJas3b7lfhY7V+X p+ZKbZWmJfASbYId72/b/J5UXcyyqRA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-r3nWBIOgO96CXH_SFe2SQA-1; Fri, 26 Jan 2024 21:35:49 -0500 X-MC-Unique: r3nWBIOgO96CXH_SFe2SQA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6BD7E1013767; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: from vdo-builder-msakai.permabit.com (vdo-builder-msakai.permabit.lab.eng.bos.redhat.com [10.0.103.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67347492BFA; Sat, 27 Jan 2024 02:35:49 +0000 (UTC) Received: by vdo-builder-msakai.permabit.com (Postfix, from userid 1138) id 65C77560C9; Fri, 26 Jan 2024 21:35:49 -0500 (EST) From: Matthew Sakai To: dm-devel@lists.linux.dev Cc: Mike Snitzer , Matthew Sakai Subject: [PATCH 5/5] dm vdo block-map: rename struct cursors member to 'completion' Date: Fri, 26 Jan 2024 21:35:49 -0500 Message-ID: <3aef47736fad201d97e01e5284f0896916e02e81.1706322049.git.msakai@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Mike Snitzer 'completion' is more informative name for a 'struct vdo_completion' than 'parent'. Signed-off-by: Mike Snitzer Signed-off-by: Matthew Sakai --- drivers/md/dm-vdo/block-map.c | 20 +++++++++----------- drivers/md/dm-vdo/block-map.h | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index 0ce136612869..50dda7ae7074 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -98,7 +98,7 @@ struct cursors { struct block_map_zone *zone; struct vio_pool *pool; vdo_entry_callback_fn entry_callback; - struct vdo_completion *parent; + struct vdo_completion *completion; root_count_t active_roots; struct cursor cursors[]; }; @@ -2501,7 +2501,7 @@ static void replace_forest(struct block_map *map) static void finish_cursor(struct cursor *cursor) { struct cursors *cursors = cursor->parent; - struct vdo_completion *parent = cursors->parent; + struct vdo_completion *completion = cursors->completion; return_vio_to_pool(cursors->pool, uds_forget(cursor->vio)); if (--cursors->active_roots > 0) @@ -2509,7 +2509,7 @@ static void finish_cursor(struct cursor *cursor) uds_free(cursors); - vdo_finish_completion(parent); + vdo_finish_completion(completion); } static void traverse(struct cursor *cursor); @@ -2595,12 +2595,10 @@ static void traverse(struct cursor *cursor) if (cursor->height < VDO_BLOCK_MAP_TREE_HEIGHT - 1) { int result = cursor->parent->entry_callback(location.pbn, - cursor->parent->parent); - + cursor->parent->completion); if (result != VDO_SUCCESS) { page->entries[level->slot] = UNMAPPED_BLOCK_MAP_ENTRY; - vdo_write_tree_page(tree_page, - cursor->parent->zone); + vdo_write_tree_page(tree_page, cursor->parent->zone); continue; } } @@ -2676,10 +2674,10 @@ static struct boundary compute_boundary(struct block_map *map, root_count_t root /** * vdo_traverse_forest() - Walk the entire forest of a block map. * @callback: A function to call with the pbn of each allocated node in the forest. - * @parent: The completion to notify on each traversed PBN, and when the traversal is complete. + * @completion: The completion to notify on each traversed PBN, and when traversal completes. */ void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, - struct vdo_completion *parent) + struct vdo_completion *completion) { root_count_t root; struct cursors *cursors; @@ -2688,14 +2686,14 @@ void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, result = uds_allocate_extended(struct cursors, map->root_count, struct cursor, __func__, &cursors); if (result != VDO_SUCCESS) { - vdo_fail_completion(parent, result); + vdo_fail_completion(completion, result); return; } cursors->zone = &map->zones[0]; cursors->pool = cursors->zone->vio_pool; cursors->entry_callback = callback; - cursors->parent = parent; + cursors->completion = completion; cursors->active_roots = map->root_count; for (root = 0; root < map->root_count; root++) { struct cursor *cursor = &cursors->cursors[root]; diff --git a/drivers/md/dm-vdo/block-map.h b/drivers/md/dm-vdo/block-map.h index cc98d19309ce..c574bd524bc2 100644 --- a/drivers/md/dm-vdo/block-map.h +++ b/drivers/md/dm-vdo/block-map.h @@ -313,7 +313,7 @@ physical_block_number_t vdo_find_block_map_page_pbn(struct block_map *map, void vdo_write_tree_page(struct tree_page *page, struct block_map_zone *zone); void vdo_traverse_forest(struct block_map *map, vdo_entry_callback_fn callback, - struct vdo_completion *parent); + struct vdo_completion *completion); int __must_check vdo_decode_block_map(struct block_map_state_2_0 state, block_count_t logical_blocks, struct vdo *vdo,