Re: [f2fs-dev] [PATCH] f2fs: add unlikely() macro for compiler more aggressively

2013-12-06 Thread Chao Yu
-Original Message- From: Jaegeuk Kim [mailto:jaegeuk@samsung.com] Sent: Friday, December 06, 2013 2:15 PM Cc: Jaegeuk Kim; linux-fsde...@vger.kernel.org; linux-ker...@vger.kernel.org; linux-f2fs-devel@lists.sourceforge.net; Chao Yu Subject: [PATCH] f2fs: add unlikely() macro for

Re: [f2fs-dev] [PATCH] f2fs: add unlikely() macro for compiler more aggressively

2013-12-06 Thread Andi Kleen
Jaegeuk Kim jaegeuk@samsung.com writes: struct page *page; repeat: page = grab_cache_page(mapping, index); - if (!page) { + if (unlikely(!page)) { This is completely pointless, gcc already considers any test for NULL unlikely. In general i would advise against

[f2fs-dev] [PATCH] f2fs: add unlikely() macro for compiler more aggressively

2013-12-05 Thread Jaegeuk Kim
This patch adds unlikely() macro into the most of codes. The basic rule is to add that when: - checking unusual errors, - checking page mappings, - and the other unlikely conditions. Cc: Chao Yu chao2...@samsung.com Signed-off-by: Jaegeuk Kim jaegeuk@samsung.com --- fs/f2fs/checkpoint.c |