• Jane Chu's avatar
    ipc/shm.c add ->pagesize function to shm_vm_ops · eec3636a
    Jane Chu authored
    Commit 05ea8860 ("mm, hugetlbfs: introduce ->pagesize() to
    vm_operations_struct") adds a new ->pagesize() function to
    hugetlb_vm_ops, intended to cover all hugetlbfs backed files.
    With System V shared memory model, if "huge page" is specified, the
    "shared memory" is backed by hugetlbfs files, but the mappings initiated
    via shmget/shmat have their original vm_ops overwritten with shm_vm_ops,
    so we need to add a ->pagesize function to shm_vm_ops.  Otherwise,
    vma_kernel_pagesize() returns PAGE_SIZE given a hugetlbfs backed vma,
    result in below BUG:
            443             if (unlikely(page_mapped(page))) {
            444                     BUG_ON(truncate_op);
    resulting in
      hugetlbfs: oracle (4592): Using mlock ulimits for SHM_HUGETLB is deprecated
      ------------[ cut here ]------------
      kernel BUG at fs/hugetlbfs/inode.c:444!
      Modules linked in: nfsv3 rpcsec_gss_krb5 nfsv4 ...
      CPU: 35 PID: 5583 Comm: oracle_5583_sbt Not tainted 4.14.35-1829.el7uek.x86_64 #2
      RIP: 0010:remove_inode_hugepages+0x3db/0x3e2
      Call Trace:
    [jane.chu@oracle.com: relocate comment]
      Link: http://lkml.kernel.org/r/20180731044831.26036-1-jane.chu@oracle.com
    Link: http://lkml.kernel.org/r/20180727211727.5020-1-jane.chu@oracle.com
    Fixes: 05ea8860 ("mm, hugetlbfs: introduce ->pagesize() to vm_operations_struct")
    Signed-off-by: default avatarJane Chu <jane.chu@oracle.com>
    Suggested-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
    Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
    Acked-by: default avatarDavidlohr Bueso <dave@stgolabs.net>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: Jan Kara <jack@suse.cz>
    Cc: Jérôme Glisse <jglisse@redhat.com>
    Cc: Manfred Spraul <manfred@colorfullife.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Last commit
Last update
Makefile Loading commit data...
compat.c Loading commit data...
ipc_sysctl.c Loading commit data...
mq_sysctl.c Loading commit data...
mqueue.c Loading commit data...
msg.c Loading commit data...
msgutil.c Loading commit data...
namespace.c Loading commit data...
sem.c Loading commit data...
shm.c Loading commit data...
syscall.c Loading commit data...
util.c Loading commit data...
util.h Loading commit data...