Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3b910105
Commit
3b910105
authored
Dec 09, 2022
by
Andrew Morton
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mm-hotfixes-stable' into mm-stable
parents
e0ff4280
4a7ba45b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
22 deletions
+43
-22
.mailmap
.mailmap
+3
-0
MAINTAINERS
MAINTAINERS
+2
-2
include/linux/cgroup.h
include/linux/cgroup.h
+1
-0
include/linux/swapops.h
include/linux/swapops.h
+5
-3
kernel/cgroup/cgroup-internal.h
kernel/cgroup/cgroup-internal.h
+0
-1
mm/gup.c
mm/gup.c
+1
-1
mm/memcontrol.c
mm/memcontrol.c
+13
-2
mm/mmap.c
mm/mmap.c
+4
-10
mm/shmem.c
mm/shmem.c
+11
-0
tools/testing/selftests/cgroup/test_kmem.c
tools/testing/selftests/cgroup/test_kmem.c
+3
-3
No files found.
.mailmap
View file @
3b910105
...
...
@@ -287,6 +287,7 @@ Matthew Wilcox <willy@infradead.org> <willy@linux.intel.com>
Matthew Wilcox <willy@infradead.org> <willy@parisc-linux.org>
Matthias Fuchs <socketcan@esd.eu> <matthias.fuchs@esd.eu>
Matthieu CASTET <castet.matthieu@free.fr>
Matti Vaittinen <mazziesaccount@gmail.com> <matti.vaittinen@fi.rohmeurope.com>
Matt Ranostay <matt.ranostay@konsulko.com> <matt@ranostay.consulting>
Matt Ranostay <mranostay@gmail.com> Matthew Ranostay <mranostay@embeddedalley.com>
Matt Ranostay <mranostay@gmail.com> <matt.ranostay@intel.com>
...
...
@@ -372,6 +373,8 @@ Ricardo Ribalda <ribalda@kernel.org> <ricardo.ribalda@gmail.com>
Roman Gushchin <roman.gushchin@linux.dev> <guro@fb.com>
Roman Gushchin <roman.gushchin@linux.dev> <guroan@gmail.com>
Roman Gushchin <roman.gushchin@linux.dev> <klamm@yandex-team.ru>
Muchun Song <muchun.song@linux.dev> <songmuchun@bytedance.com>
Muchun Song <muchun.song@linux.dev> <smuchun@gmail.com>
Ross Zwisler <zwisler@kernel.org> <ross.zwisler@linux.intel.com>
Rudolf Marek <R.Marek@sh.cvut.cz>
Rui Saraiva <rmps@joel.ist.utl.pt>
...
...
MAINTAINERS
View file @
3b910105
...
...
@@ -5299,7 +5299,7 @@ M: Johannes Weiner <hannes@cmpxchg.org>
M: Michal Hocko <mhocko@kernel.org>
M: Roman Gushchin <roman.gushchin@linux.dev>
M: Shakeel Butt <shakeelb@google.com>
R: Muchun Song <
songmuchun@bytedance.com
>
R: Muchun Song <
muchun.song@linux.dev
>
L: cgroups@vger.kernel.org
L: linux-mm@kvack.org
S: Maintained
...
...
@@ -9443,7 +9443,7 @@ F: drivers/net/ethernet/huawei/hinic/
HUGETLB SUBSYSTEM
M: Mike Kravetz <mike.kravetz@oracle.com>
M: Muchun Song <
songmuchun@bytedance.com
>
M: Muchun Song <
muchun.song@linux.dev
>
L: linux-mm@kvack.org
S: Maintained
F: Documentation/ABI/testing/sysfs-kernel-mm-hugepages
...
...
include/linux/cgroup.h
View file @
3b910105
...
...
@@ -68,6 +68,7 @@ struct css_task_iter {
struct
list_head
iters_node
;
/* css_set->task_iters */
};
extern
struct
file_system_type
cgroup_fs_type
;
extern
struct
cgroup_root
cgrp_dfl_root
;
extern
struct
css_set
init_css_set
;
...
...
include/linux/swapops.h
View file @
3b910105
...
...
@@ -35,7 +35,9 @@
#ifdef MAX_PHYSMEM_BITS
#define SWP_PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT)
#else
/* MAX_PHYSMEM_BITS */
#define SWP_PFN_BITS (BITS_PER_LONG - PAGE_SHIFT)
#define SWP_PFN_BITS min_t(int, \
sizeof(phys_addr_t) * 8 - PAGE_SHIFT, \
SWP_TYPE_SHIFT)
#endif
/* MAX_PHYSMEM_BITS */
#define SWP_PFN_MASK (BIT(SWP_PFN_BITS) - 1)
...
...
kernel/cgroup/cgroup-internal.h
View file @
3b910105
...
...
@@ -167,7 +167,6 @@ struct cgroup_mgctx {
extern
spinlock_t
css_set_lock
;
extern
struct
cgroup_subsys
*
cgroup_subsys
[];
extern
struct
list_head
cgroup_roots
;
extern
struct
file_system_type
cgroup_fs_type
;
/* iterate across the hierarchies */
#define for_each_root(root) \
...
...
mm/gup.c
View file @
3b910105
...
...
@@ -2767,7 +2767,7 @@ static int gup_pud_range(p4d_t *p4dp, p4d_t p4d, unsigned long addr, unsigned lo
next
=
pud_addr_end
(
addr
,
end
);
if
(
unlikely
(
!
pud_present
(
pud
)))
return
0
;
if
(
unlikely
(
pud_huge
(
pud
)))
{
if
(
unlikely
(
pud_huge
(
pud
)
||
pud_devmap
(
pud
)
))
{
if
(
!
gup_huge_pud
(
pud
,
pudp
,
addr
,
next
,
flags
,
pages
,
nr
))
return
0
;
...
...
mm/memcontrol.c
View file @
3b910105
...
...
@@ -4836,6 +4836,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
unsigned
int
efd
,
cfd
;
struct
fd
efile
;
struct
fd
cfile
;
struct
dentry
*
cdentry
;
const
char
*
name
;
char
*
endp
;
int
ret
;
...
...
@@ -4889,6 +4890,16 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
if
(
ret
<
0
)
goto
out_put_cfile
;
/*
* The control file must be a regular cgroup1 file. As a regular cgroup
* file can't be renamed, it's safe to access its name afterwards.
*/
cdentry
=
cfile
.
file
->
f_path
.
dentry
;
if
(
cdentry
->
d_sb
->
s_type
!=
&
cgroup_fs_type
||
!
d_is_reg
(
cdentry
))
{
ret
=
-
EINVAL
;
goto
out_put_cfile
;
}
/*
* Determine the event callbacks and set them in @event. This used
* to be done via struct cftype but cgroup core no longer knows
...
...
@@ -4897,7 +4908,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
*
* DO NOT ADD NEW FILES.
*/
name
=
c
file
.
file
->
f_path
.
dentry
->
d_name
.
name
;
name
=
cdentry
->
d_name
.
name
;
if
(
!
strcmp
(
name
,
"memory.usage_in_bytes"
))
{
event
->
register_event
=
mem_cgroup_usage_register_event
;
...
...
@@ -4921,7 +4932,7 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
* automatically removed on cgroup destruction but the removal is
* asynchronous, so take an extra ref on @css.
*/
cfile_css
=
css_tryget_online_from_dir
(
c
file
.
file
->
f_path
.
dentry
->
d_parent
,
cfile_css
=
css_tryget_online_from_dir
(
cdentry
->
d_parent
,
&
memory_cgrp_subsys
);
ret
=
-
EINVAL
;
if
(
IS_ERR
(
cfile_css
))
...
...
mm/mmap.c
View file @
3b910105
...
...
@@ -226,8 +226,7 @@ SYSCALL_DEFINE1(brk, unsigned long, brk)
/* Search one past newbrk */
mas_set
(
&
mas
,
newbrk
);
brkvma
=
mas_find
(
&
mas
,
oldbrk
);
BUG_ON
(
brkvma
==
NULL
);
if
(
brkvma
->
vm_start
>=
oldbrk
)
if
(
!
brkvma
||
brkvma
->
vm_start
>=
oldbrk
)
goto
out
;
/* mapping intersects with an existing non-brk vma. */
/*
* mm->brk must be protected by write mmap_lock.
...
...
@@ -2949,9 +2948,9 @@ static int do_brk_flags(struct ma_state *mas, struct vm_area_struct *vma,
* Expand the existing vma if possible; Note that singular lists do not
* occur after forking, so the expand will only happen on new VMAs.
*/
if
(
vma
&&
(
!
vma
->
anon_vma
||
list_is_singular
(
&
vma
->
anon_vma_chain
))
&&
((
vma
->
vm_flags
&
~
VM_SOFTDIRTY
)
==
flags
))
{
if
(
vma
&&
vma
->
vm_end
==
addr
&&
!
vma_policy
(
vma
)
&&
can_vma_merge_after
(
vma
,
flags
,
NULL
,
NULL
,
addr
>>
PAGE_SHIFT
,
NULL_VM_UFFD_CTX
,
NULL
))
{
mas_set_range
(
mas
,
vma
->
vm_start
,
addr
+
len
-
1
);
if
(
mas_preallocate
(
mas
,
vma
,
GFP_KERNEL
))
return
-
ENOMEM
;
...
...
@@ -3038,11 +3037,6 @@ int vm_brk_flags(unsigned long addr, unsigned long request, unsigned long flags)
goto
munmap_failed
;
vma
=
mas_prev
(
&
mas
,
0
);
if
(
!
vma
||
vma
->
vm_end
!=
addr
||
vma_policy
(
vma
)
||
!
can_vma_merge_after
(
vma
,
flags
,
NULL
,
NULL
,
addr
>>
PAGE_SHIFT
,
NULL_VM_UFFD_CTX
,
NULL
))
vma
=
NULL
;
ret
=
do_brk_flags
(
&
mas
,
vma
,
addr
,
len
,
flags
);
populate
=
((
mm
->
def_flags
&
VM_LOCKED
)
!=
0
);
mmap_write_unlock
(
mm
);
...
...
mm/shmem.c
View file @
3b910105
...
...
@@ -950,6 +950,15 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
cond_resched
();
}
/*
* When undoing a failed fallocate, we want none of the partial folio
* zeroing and splitting below, but shall want to truncate the whole
* folio when !uptodate indicates that it was added by this fallocate,
* even when [lstart, lend] covers only a part of the folio.
*/
if
(
unfalloc
)
goto
whole_folios
;
same_folio
=
(
lstart
>>
PAGE_SHIFT
)
==
(
lend
>>
PAGE_SHIFT
);
folio
=
shmem_get_partial_folio
(
inode
,
lstart
>>
PAGE_SHIFT
);
if
(
folio
)
{
...
...
@@ -975,6 +984,8 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
folio_put
(
folio
);
}
whole_folios:
index
=
start
;
while
(
index
<
end
)
{
cond_resched
();
...
...
tools/testing/selftests/cgroup/test_kmem.c
View file @
3b910105
...
...
@@ -19,12 +19,12 @@
/*
* Memory cgroup charging is performed using percpu batches
32
pages
* Memory cgroup charging is performed using percpu batches
64
pages
* big (look at MEMCG_CHARGE_BATCH), whereas memory.stat is exact. So
* the maximum discrepancy between charge and vmstat entries is number
* of cpus multiplied by
32
pages.
* of cpus multiplied by
64
pages.
*/
#define MAX_VMSTAT_ERROR (4096 *
32
* get_nprocs())
#define MAX_VMSTAT_ERROR (4096 *
64
* get_nprocs())
static
int
alloc_dcache
(
const
char
*
cgroup
,
void
*
arg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment