Axel Rasmussen
0b161cf6fc
FROMGIT: userfaultfd/shmem: modify shmem_mfill_atomic_pte to use install_pte()
...
In a previous commit, we added the mfill_atomic_install_pte() helper.
This helper does the job of setting up PTEs for an existing page, to map
it into a given VMA. It deals with both the anon and shmem cases, as well
as the shared and private cases.
In other words, shmem_mfill_atomic_pte() duplicates a case it already
handles. So, expose it, and let shmem_mfill_atomic_pte() use it directly,
to reduce code duplication.
This requires that we refactor shmem_mfill_atomic_pte() a bit:
Instead of doing accounting (shmem_recalc_inode() et al) part-way through
the PTE setup, do it afterward. This frees up mfill_atomic_install_pte()
from having to care about this accounting, and means we don't need to e.g.
shmem_uncharge() in the error path.
A side effect is this switches shmem_mfill_atomic_pte() to use
lru_cache_add_inactive_or_unevictable() instead of just lru_cache_add().
This wrapper does some extra accounting in an exceptional case, if
appropriate, so it's actually the more correct thing to use.
Link: https://lkml.kernel.org/r/20210503180737.2487560-7-axelrasmussen@google.com
Signed-off-by: Axel Rasmussen <axelrasmussen@google.com >
Reviewed-by: Peter Xu <peterx@redhat.com >
Acked-by: Hugh Dickins <hughd@google.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Andrea Arcangeli <aarcange@redhat.com >
Cc: Brian Geffon <bgeffon@google.com >
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com >
Cc: Jerome Glisse <jglisse@redhat.com >
Cc: Joe Perches <joe@perches.com >
Cc: Kirill A. Shutemov <kirill@shutemov.name >
Cc: Lokesh Gidra <lokeshgidra@google.com >
Cc: Mike Kravetz <mike.kravetz@oracle.com >
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com >
Cc: Mina Almasry <almasrymina@google.com >
Cc: Oliver Upton <oupton@google.com >
Cc: Shaohua Li <shli@fb.com >
Cc: Shuah Khan <shuah@kernel.org >
Cc: Stephen Rothwell <sfr@canb.auug.org.au >
Cc: Wang Qing <wangqing@vivo.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au >
(cherry picked from commit 7ec5412f689eaa304395d3b6f857d98353ecc1d7
https: //git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
akpm)
Link: https://lore.kernel.org/patchwork/patch/1420973/
Signed-off-by: Lokesh Gidra <lokeshgidra@google.com >
Bug: 187930641
Change-Id: I130c9f7cdfe0404dbd7bed48f19eddec65ea1c48
2021-06-04 19:13:10 +00:00
..
2021-03-01 12:52:06 -08:00
2021-04-14 08:42:06 +02:00
2021-04-09 21:09:05 -07:00
2021-03-24 20:43:25 +00:00
2020-10-29 17:22:59 -05:00
2021-05-14 09:50:05 +02:00
2021-05-14 09:50:31 +02:00
2020-12-30 11:54:19 +01:00
2021-01-28 17:57:10 +00:00
2020-10-29 17:22:59 -05:00
2021-05-11 14:47:31 +02:00
2021-06-03 09:00:36 +02:00
2021-05-21 13:17:07 -07:00
2020-10-25 14:51:49 -07:00
2021-04-02 15:25:50 +02:00
2021-04-21 13:00:56 +02:00
2021-04-21 13:00:55 +02:00
2021-04-28 13:39:59 +02:00
2021-05-11 14:47:24 +02:00
2021-03-25 17:15:27 +01:00
2021-04-23 18:42:38 -07:00
2021-03-04 11:38:14 +01:00
2021-05-15 09:31:41 +02:00
2021-06-03 09:00:51 +02:00
2021-06-04 11:15:19 -07:00
2021-03-09 11:11:13 +01:00
2021-04-09 09:29:17 +02:00
2021-06-04 11:15:20 -07:00
2021-03-15 07:47:37 +00:00
2021-01-27 09:43:35 +00:00
2021-02-05 11:03:56 +00:00
2021-05-11 22:55:07 +00:00
2021-02-05 17:37:33 +00:00
2021-05-11 09:34:37 -07:00
2021-06-03 09:00:45 +02:00
2021-03-18 16:03:05 +01:00
2021-01-12 20:18:17 +01:00
2021-05-21 13:17:09 -07:00
2021-06-03 19:57:28 +00:00
2021-05-07 11:04:31 +02:00
2021-04-29 13:57:47 +02:00
2021-04-09 21:09:04 -07:00
2021-03-23 04:05:31 +00:00
2020-12-11 14:02:14 -08:00
2020-10-25 14:51:49 -07:00
2021-01-14 16:28:57 +00:00
2021-02-11 12:29:55 +00:00
2021-02-11 14:41:53 +00:00
2021-01-25 12:21:02 -08:00
2021-04-21 23:59:41 +00:00
2020-11-02 09:27:42 +01:00
2020-10-25 14:51:49 -07:00
2021-01-14 16:29:15 +00:00
2021-03-19 09:42:56 +01:00
2021-01-19 18:27:21 +01:00
2020-11-14 11:26:03 -08:00
2021-05-26 12:06:56 +02:00
2021-06-03 09:00:45 +02:00
2021-05-28 13:17:43 +02:00
2021-03-01 12:52:12 -08:00
2021-03-01 12:52:16 -08:00
2020-12-08 19:08:52 +00:00
2020-11-13 08:26:07 +01:00
2021-06-04 11:15:17 -07:00
2021-02-05 09:20:53 +00:00
2021-05-13 07:53:31 +00:00
2020-11-06 18:49:04 +00:00
2020-10-30 08:37:39 +01:00
2021-04-02 15:25:50 +02:00
2021-06-04 11:15:18 -07:00
2021-01-19 18:27:22 +01:00
2021-03-09 03:44:12 +00:00
2021-04-07 14:17:51 +00:00
2021-02-10 19:42:19 +00:00
2021-03-18 16:08:25 +01:00
2021-05-21 13:17:04 -07:00
2021-04-23 18:42:37 -07:00
2021-03-11 16:16:38 +00:00
2020-10-25 14:51:49 -07:00
2021-03-11 14:17:27 +01:00
2021-03-25 09:04:18 +01:00
2021-06-04 11:15:17 -07:00
2020-12-11 14:02:14 -08:00
2021-03-02 17:34:28 -08:00
2021-03-17 17:06:36 +01:00
2021-03-18 16:09:29 +01:00
2021-03-04 11:38:41 +01:00
2021-04-23 18:42:37 -07:00
2021-04-07 15:00:11 +02:00
2021-03-24 15:50:11 -07:00
2021-03-04 11:37:22 +01:00
2020-10-25 14:51:49 -07:00
2021-06-02 15:42:01 +00:00
2021-03-01 19:06:56 -08:00
2021-02-26 05:46:24 +00:00
2020-12-30 11:54:18 +01:00
2020-11-24 16:16:54 +00:00
2021-03-01 19:06:56 -08:00
2021-03-24 20:43:25 +00:00
2021-03-18 16:09:52 +01:00
2020-12-01 18:07:54 +00:00
2021-05-14 09:50:28 +02:00
2020-12-01 18:05:53 +00:00
2021-04-16 11:43:20 +02:00
2021-03-18 16:10:11 +01:00
2021-03-30 14:31:54 +02:00
2021-01-22 18:01:16 +00:00
2021-04-09 15:35:59 -07:00
2021-05-19 10:12:54 +02:00
2021-03-04 11:38:46 +01:00
2021-03-30 14:31:57 +02:00
2020-10-25 14:51:49 -07:00
2021-01-14 16:29:15 +00:00
2021-05-19 10:13:17 +02:00
2020-11-10 19:07:11 +00:00
2020-11-04 10:22:56 -07:00
2021-04-09 21:09:05 -07:00
2021-03-18 16:17:14 +01:00
2021-05-15 09:28:55 +02:00
2021-03-18 16:17:31 +01:00
2021-03-18 16:04:29 +01:00
2021-02-10 09:29:17 +01:00
2021-03-18 16:17:47 +01:00
2020-11-19 22:38:29 -05:00
2020-10-29 13:17:58 -05:00
2021-02-07 13:41:42 -08:00
2021-04-25 14:59:34 +02:00
2021-01-09 13:46:23 +01:00
2020-10-25 14:51:49 -07:00
2021-03-18 16:18:05 +01:00
2021-03-04 11:37:50 +01:00
2021-03-04 11:37:59 +01:00
2021-02-23 08:10:56 +01:00
2021-02-05 09:20:54 -08:00
2021-03-04 11:38:46 +01:00
2021-03-04 11:38:20 +01:00
2021-03-18 16:18:19 +01:00
2021-02-10 09:29:16 +01:00
2021-02-07 15:37:17 +01:00
2021-05-14 09:50:04 +02:00
2021-02-03 23:28:40 +01:00
2021-01-11 16:43:50 +00:00
2021-02-05 11:03:49 +00:00
2021-02-05 11:03:49 +00:00
2021-04-21 13:01:00 +02:00
2021-05-21 09:05:32 +05:30
2021-03-30 14:31:47 +02:00
2021-01-12 18:23:34 +00:00
2021-03-17 17:06:25 +01:00
2021-03-04 11:38:21 +01:00
2021-03-23 04:05:24 +00:00
2021-06-03 09:00:45 +02:00
2021-06-04 11:15:16 -07:00
2021-05-20 15:35:25 +02:00
2021-02-05 09:20:52 +00:00
2021-04-02 15:25:50 +02:00
2021-04-20 21:26:32 +00:00
2021-03-22 15:05:55 +00:00
2021-01-19 21:47:30 -08:00
2020-10-25 14:51:49 -07:00
2021-03-23 08:00:57 +01:00
2021-02-10 09:29:17 +01:00
2021-06-04 11:15:19 -07:00
2021-03-18 16:04:29 +01:00
2021-04-09 21:09:05 -07:00
2020-10-30 12:57:39 +01:00
2020-10-30 12:57:39 +01:00
2020-11-30 10:52:22 -05:00
2021-05-19 10:13:02 +02:00
2020-11-22 10:48:22 -08:00
2021-02-07 15:37:16 +01:00
2020-10-25 14:51:49 -07:00
2021-02-25 15:16:39 -08:00
2021-03-11 19:35:01 +01:00
2021-06-03 20:59:15 +00:00
2021-04-03 14:11:30 +00:00
2021-04-30 09:13:34 -07:00
2021-04-01 00:09:00 +00:00
2021-04-30 09:13:34 -07:00
2021-01-19 21:47:30 -08:00
2021-04-02 15:25:50 +02:00
2021-05-19 10:13:01 +02:00
2021-05-19 10:13:01 +02:00
2021-03-18 16:02:34 +01:00
2020-10-25 14:51:49 -07:00
2021-05-11 14:47:31 +02:00
2020-11-09 18:12:34 +01:00
2021-03-17 17:06:28 +01:00
2021-04-09 21:09:03 -07:00
2021-05-14 09:50:14 +02:00
2021-04-23 18:42:36 -07:00
2021-05-14 09:50:16 +02:00
2021-06-04 11:15:17 -07:00
2021-03-24 15:09:17 -07:00
2021-04-14 17:36:16 +00:00
2021-05-21 13:17:09 -07:00
2020-12-30 11:53:56 +01:00
2021-01-21 18:04:03 -08:00
2021-01-28 17:57:12 +00:00
2021-04-07 15:00:13 +02:00
2021-03-18 16:20:07 +01:00
2021-03-04 11:38:35 +01:00
2020-10-28 11:41:15 -06:00
2021-05-07 07:12:41 -07:00
2021-03-07 12:33:33 +01:00
2021-06-04 11:15:19 -07:00
2021-06-04 11:15:16 -07:00
2021-03-02 17:34:35 -08:00
2021-01-07 17:56:54 -08:00
2021-02-05 11:03:49 +00:00
2020-12-30 11:53:42 +01:00
2020-11-06 10:05:18 -08:00
2021-03-17 17:06:34 +01:00
2020-10-25 14:51:49 -07:00
2021-06-04 19:12:40 +00:00
2021-06-04 11:15:20 -07:00
2021-01-22 10:05:52 -08:00
2021-01-22 10:05:52 -08:00
2021-03-18 16:04:29 +01:00
2021-04-14 08:42:01 +02:00
2021-02-05 09:20:53 -08:00
2020-10-25 11:39:02 -07:00
2021-02-05 09:20:53 -08:00
2021-05-14 09:50:46 +02:00
2020-10-25 14:51:49 -07:00
2021-02-15 15:11:44 -08:00
2021-03-30 14:31:53 +02:00
2021-03-30 14:31:53 +02:00
2020-12-08 14:52:29 -08:00
2021-03-19 09:42:56 +01:00
2021-01-19 21:47:30 -08:00
2021-03-23 04:05:15 +00:00
2021-05-21 13:17:04 -07:00
2021-01-17 14:16:59 +01:00
2020-11-27 16:50:51 +00:00
2021-03-25 09:04:16 +01:00
2020-10-26 11:48:11 +01:00
2021-03-18 16:20:25 +01:00
2021-03-04 11:38:29 +01:00
2020-10-25 14:51:49 -07:00
2020-12-30 11:53:42 +01:00
2021-02-10 09:29:16 +01:00
2021-05-15 13:25:01 +02:00
2021-03-04 11:37:36 +01:00
2021-05-15 13:25:01 +02:00
2021-03-30 14:31:51 +02:00
2020-10-28 15:08:39 +01:00
2021-05-14 09:50:31 +02:00
2021-02-17 11:02:28 +01:00
2021-03-11 16:02:50 +00:00
2021-03-25 09:04:14 +01:00
2021-03-17 17:06:19 +01:00
2021-05-21 13:17:04 -07:00
2021-06-04 19:13:10 +00:00
2021-03-30 14:32:03 +02:00
2021-05-22 11:40:52 +02:00
2021-02-01 19:32:29 +00:00
2021-04-23 18:42:39 -07:00
2021-05-21 13:17:08 -07:00
2021-04-07 15:00:06 +02:00
2021-03-07 12:34:15 +01:00