]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mm/slub.c: avoid double string traverse in kmem_cache_flags()
authorYury Norov <yury.norov@gmail.com>
Fri, 12 Jul 2019 03:53:33 +0000 (20:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Jul 2019 18:05:41 +0000 (11:05 -0700)
commit9cf3a8d847bd08977dc168ed243ffbef3c456d88
tree7d5790a9f4c223ea58bf9b09befadaf821fe4428
parent966fede8e4be15bcc08e3c390080d3f9072a5367
mm/slub.c: avoid double string traverse in kmem_cache_flags()

If ',' is not found, kmem_cache_flags() calls strlen() to find the end of
line.  We can do it in a single pass using strchrnul().

Link: http://lkml.kernel.org/r/20190501053111.7950-1-ynorov@marvell.com
Signed-off-by: Yury Norov <ynorov@marvell.com>
Acked-by: Aaron Tomlin <atomlin@redhat.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slub.c