Strange condition in invalidate_mapping_pages()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kirill,

in commit fc127da085c26 "truncate: handle file thp" you've added the
following to invalidate_mapping_pages():

          /* Middle of THP: skip */
          if (PageTransTail(page)) {
                  unlock_page(page);
                  continue;
          } else if (PageTransHuge(page)) {
                  index += HPAGE_PMD_NR - 1;
                  i += HPAGE_PMD_NR - 1;
                  /* 'end' is in the middle of THP */
                  if (index ==  round_down(end, HPAGE_PMD_NR))
                          continue;
          }

Now how can ever condition "if (index ==  round_down(end,
HPAGE_PMD_NR))" be true? We have just added HPAGE_PMD_NR - 1 to 'index'
so it will not be a multiple of HPAGE_PMD_NR. Presumably you wanted to
check whether the current THP is the one containing 'end' here which would
be something like 'round_down(index, HPAGE_PMD_NR) == round_down(end,
HPAGE_PMD_NR)' but then I still miss why you'd like to avoid invalidating
the partial THP at the end of file... Can you please enlighten me? Thanks!

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux