From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 02/21] blkcg: BLKIO_STAT_CPU_SECTORS doesn't have subcounters Date: Wed, 28 Mar 2012 15:51:12 -0700 Message-ID: <1332975091-10950-3-git-send-email-tj@kernel.org> References: <1332975091-10950-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=3RA/LLKhXPiTDRqMLooPxZJ64w9X9BiOEpOMo09jvak=; b=af7de4n3fLHqyuD2HqZMPbtEmbgMwYW97pvCs9Zbces7TWXxP+yzHY3tvy91/rdDcf KQjdlxWAxIByGnfaVZkxeRfz7e2hLmB2lqPNo3VTU/yXtpoTyl1zHnIDIB2fJgVMf6XE UfmJ1tqTJkj+sDMgg/Nh0/kE4MBb2kWD4FWltqPPihFnHujtS9mkOMfS4dxre9fytW2Y 1Z813fluwK7WOTi4cvxrJlq2YvWq0DK+1ZC9OC8GfeimkjClF/FTus5GYT1IjzGgMNyI 9O7XTVMRwmhsiiteNQtHFPTfvKxGCKby/9a2nfPm7pT8cT1RQ/fjkBHlEtlR5AQs+j/u 5dNQ== In-Reply-To: <1332975091-10950-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org Cc: ctalbott-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, rni-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tejun Heo , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org BLKIO_STAT_CPU_SECTORS doesn't need read/write/sync/async subcounters and is counted by blkio_group_stats_cpu->sectors; however, it still holds a member in blkio_group_stats_cpu->stat_arr_cpu. Rearrange stat_type_cpu and define BLKIO_STAT_CPU_ARR_NR and use it for stat_arr_cpu[] size so that only SERVICE_BYTES and SERVICED have subcounters. Signed-off-by: Tejun Heo --- block/blk-cgroup.h | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 1add3dc..2060d81 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -58,14 +58,17 @@ enum stat_type { /* Per cpu stats */ enum stat_type_cpu { - BLKIO_STAT_CPU_SECTORS, /* Total bytes transferred */ BLKIO_STAT_CPU_SERVICE_BYTES, /* Total IOs serviced, post merge */ BLKIO_STAT_CPU_SERVICED, - BLKIO_STAT_CPU_NR + + /* All the single valued stats go below this */ + BLKIO_STAT_CPU_SECTORS, }; +#define BLKIO_STAT_CPU_ARR_NR (BLKIO_STAT_CPU_SERVICED + 1) + enum stat_sub_type { BLKIO_STAT_READ = 0, BLKIO_STAT_WRITE, @@ -167,7 +170,7 @@ struct blkio_group_stats { /* Per cpu blkio group stats */ struct blkio_group_stats_cpu { uint64_t sectors; - uint64_t stat_arr_cpu[BLKIO_STAT_CPU_NR][BLKIO_STAT_TOTAL]; + uint64_t stat_arr_cpu[BLKIO_STAT_CPU_ARR_NR][BLKIO_STAT_TOTAL]; struct u64_stats_sync syncp; }; -- 1.7.7.3