Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-17 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 11:45:42PM -0400, Waiman Long wrote: > On 06/16/2014 04:59 PM, Kirill A. Shutemov wrote: > >On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: > >>On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: > >>>In the __split_huge_page_map() function, the

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-17 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 11:45:42PM -0400, Waiman Long wrote: On 06/16/2014 04:59 PM, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: In the __split_huge_page_map() function, the check for

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Waiman Long
On 06/16/2014 04:59 PM, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop.

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: > On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: > > In the __split_huge_page_map() function, the check for > > page_mapcount(page) is invariant within the for loop. Because of the > > fact that the macro is

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: > In the __split_huge_page_map() function, the check for > page_mapcount(page) is invariant within the for loop. Because of the > fact that the macro is implemented using atomic_read(), the redundant > check cannot be optimized away by

[PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Waiman Long
In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop. Because of the fact that the macro is implemented using atomic_read(), the redundant check cannot be optimized away by the compiler leading to unnecessary read to the page structure. This

[PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Waiman Long
In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop. Because of the fact that the macro is implemented using atomic_read(), the redundant check cannot be optimized away by the compiler leading to unnecessary read to the page structure. This

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop. Because of the fact that the macro is implemented using atomic_read(), the redundant check cannot be optimized away by the

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Kirill A. Shutemov
On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop. Because of the fact that the macro is implemented

Re: [PATCH] mm, thp: move invariant bug check out of loop in __split_huge_page_map

2014-06-16 Thread Waiman Long
On 06/16/2014 04:59 PM, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 11:49:34PM +0300, Kirill A. Shutemov wrote: On Mon, Jun 16, 2014 at 03:35:48PM -0400, Waiman Long wrote: In the __split_huge_page_map() function, the check for page_mapcount(page) is invariant within the for loop.