diff mbox series

[1/5] xfs: mark XLOG_FORCED_SHUTDOWN as unlikely

Message ID 20200312143959.583781-2-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series [1/5] xfs: mark XLOG_FORCED_SHUTDOWN as unlikely | expand

Commit Message

Christoph Hellwig March 12, 2020, 2:39 p.m. UTC
A shutdown log is a slow failure path.  Add an unlikely annotation to
it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_log_priv.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Darrick J. Wong March 12, 2020, 11:45 p.m. UTC | #1
On Thu, Mar 12, 2020 at 03:39:55PM +0100, Christoph Hellwig wrote:
> A shutdown log is a slow failure path.  Add an unlikely annotation to
> it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Seems reasonable...
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_log_priv.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
> index b192c5a9f9fd..e400170ff4af 100644
> --- a/fs/xfs/xfs_log_priv.h
> +++ b/fs/xfs/xfs_log_priv.h
> @@ -402,7 +402,8 @@ struct xlog {
>  #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \
>  	((log)->l_buf_cancel_table + ((uint64_t)blkno % XLOG_BC_TABLE_SIZE))
>  
> -#define XLOG_FORCED_SHUTDOWN(log)	((log)->l_flags & XLOG_IO_ERROR)
> +#define XLOG_FORCED_SHUTDOWN(log) \
> +	(unlikely((log)->l_flags & XLOG_IO_ERROR))
>  
>  /* common routines */
>  extern int
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index b192c5a9f9fd..e400170ff4af 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -402,7 +402,8 @@  struct xlog {
 #define XLOG_BUF_CANCEL_BUCKET(log, blkno) \
 	((log)->l_buf_cancel_table + ((uint64_t)blkno % XLOG_BC_TABLE_SIZE))
 
-#define XLOG_FORCED_SHUTDOWN(log)	((log)->l_flags & XLOG_IO_ERROR)
+#define XLOG_FORCED_SHUTDOWN(log) \
+	(unlikely((log)->l_flags & XLOG_IO_ERROR))
 
 /* common routines */
 extern int