diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-28 09:24:15 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-08 04:14:58 -0400 |
commit | f2c5dbd7b7396457efc114f825acfdd4db4608f8 (patch) | |
tree | 9c65570230dfc05b8580c86db0154b6b2a98515c /fs/ubifs/ubifs.h | |
parent | 8daa21e61be47a5b136c4ee1be82e391a5788696 (diff) |
UBIFS: start using hrtimers
UBIFS uses timers for write-buffer write-back. It is not
crucial for us to write-back exactly on time. We are fine
to write-back a little earlier or later. And this means
we may optimize UBIFS timer so that it could be groped
with a close timer event, so that the CPU would not be
waken up just to do the write back. This is optimization
to lessen power consumption, which is important in
embedded devices UBIFS is used for.
hrtimers have a nice feature: they are effectively range
timers, and we may defind the soft and hard limits for
it. Standard timers do not have these feature. They may
only be made deferrable, but this means there is effectively
no hard limit. So, we will better use hrtimers.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r-- | fs/ubifs/ubifs.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 0a8341e14088..1bf01d820066 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -95,8 +95,8 @@ | |||
95 | */ | 95 | */ |
96 | #define BGT_NAME_PATTERN "ubifs_bgt%d_%d" | 96 | #define BGT_NAME_PATTERN "ubifs_bgt%d_%d" |
97 | 97 | ||
98 | /* Default write-buffer synchronization timeout (5 secs) */ | 98 | /* Default write-buffer synchronization timeout in seconds */ |
99 | #define DEFAULT_WBUF_TIMEOUT (5 * HZ) | 99 | #define DEFAULT_WBUF_TIMEOUT_SECS 5 |
100 | 100 | ||
101 | /* Maximum possible inode number (only 32-bit inodes are supported now) */ | 101 | /* Maximum possible inode number (only 32-bit inodes are supported now) */ |
102 | #define MAX_INUM 0xFFFFFFFF | 102 | #define MAX_INUM 0xFFFFFFFF |
@@ -650,8 +650,10 @@ typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c, | |||
650 | * @io_mutex: serializes write-buffer I/O | 650 | * @io_mutex: serializes write-buffer I/O |
651 | * @lock: serializes @buf, @lnum, @offs, @avail, @used, @next_ino and @inodes | 651 | * @lock: serializes @buf, @lnum, @offs, @avail, @used, @next_ino and @inodes |
652 | * fields | 652 | * fields |
653 | * @softlimit: soft write-buffer timeout interval | ||
654 | * @delta: hard and soft timeouts delta (the timer expire inteval is @softlimit | ||
655 | * and @softlimit + @delta) | ||
653 | * @timer: write-buffer timer | 656 | * @timer: write-buffer timer |
654 | * @timeout: timer expire interval in jiffies | ||
655 | * @need_sync: it is set if its timer expired and needs sync | 657 | * @need_sync: it is set if its timer expired and needs sync |
656 | * @next_ino: points to the next position of the following inode number | 658 | * @next_ino: points to the next position of the following inode number |
657 | * @inodes: stores the inode numbers of the nodes which are in wbuf | 659 | * @inodes: stores the inode numbers of the nodes which are in wbuf |
@@ -678,8 +680,9 @@ struct ubifs_wbuf { | |||
678 | int (*sync_callback)(struct ubifs_info *c, int lnum, int free, int pad); | 680 | int (*sync_callback)(struct ubifs_info *c, int lnum, int free, int pad); |
679 | struct mutex io_mutex; | 681 | struct mutex io_mutex; |
680 | spinlock_t lock; | 682 | spinlock_t lock; |
681 | struct timer_list timer; | 683 | ktime_t softlimit; |
682 | int timeout; | 684 | unsigned long long delta; |
685 | struct hrtimer timer; | ||
683 | int need_sync; | 686 | int need_sync; |
684 | int next_ino; | 687 | int next_ino; |
685 | ino_t *inodes; | 688 | ino_t *inodes; |