2 * SPDX-License-Identifier: MIT
4 * Copyright © 2017 Intel Corporation
8 #include <linux/mount.h>
9 #include <linux/pagemap.h>
12 #include "i915_gemfs.h"
14 int i915_gemfs_init(struct drm_i915_private
*i915
)
16 struct file_system_type
*type
;
17 struct vfsmount
*gemfs
;
19 type
= get_fs_type("tmpfs");
24 * By creating our own shmemfs mountpoint, we can pass in
25 * mount flags that better match our usecase.
27 * One example, although it is probably better with a per-file
28 * control, is selecting huge page allocations ("huge=within_size").
29 * Currently unused due to bandwidth issues (slow reads) on Broadwell+.
32 gemfs
= kern_mount(type
);
34 return PTR_ERR(gemfs
);
36 i915
->mm
.gemfs
= gemfs
;
41 void i915_gemfs_fini(struct drm_i915_private
*i915
)
43 kern_unmount(i915
->mm
.gemfs
);