linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [bug report] shmem: prepare huge= mount option and sysfs knob
@ 2017-08-17 10:25 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-08-17 10:25 UTC (permalink / raw)
  To: kirill.shutemov; +Cc: linux-mm

Hello Kirill A. Shutemov,

The patch 5a6e75f8110c: "shmem: prepare huge= mount option and sysfs
knob" from Jul 26, 2016, leads to the following static checker
warning:

	mm/shmem.c:4013 shmem_init()
	warn: assigning (-2) to unsigned variable 'SHMEM_SB(shm_mnt->mnt_sb)->huge'

mm/shmem.c
  4012  #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE
  4013          if (has_transparent_hugepage() && shmem_huge < SHMEM_HUGE_DENY)
  4014                  SHMEM_SB(shm_mnt->mnt_sb)->huge = shmem_huge;


SHMEM_HUGE_DENY is -1 so the value less than that is SHMEM_HUGE_FORCE (-2).

  4015          else
  4016                  shmem_huge = 0; /* just in case it was patched */
  4017  #endif
  4018          return 0;

Btw, if shmem_parse_huge() returns SHMEM_HUGE_FORCE, then both callers
treat that as an error.  The handling for SHMEM_HUGE_FORCE is confusing
for my tiny brain.

regards,
dan carpenter

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-17 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-17 10:25 [bug report] shmem: prepare huge= mount option and sysfs knob Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox