ERMS 0x0100 /* Reset direct map and flush
> TLB on unmap */
> +#define VM_MAP_PUT_PAGES 0x0200 /* put pages and free array in
> vfree */
>
> /* bits [20..32] reserved for arch specific ioremap internals */
>
>
Looks good to me.
Reviewed-by: Miaohe Lin
otherwise ZONE_{NORMAL,MOVABLE}
>* section.
>*/
> - if (zone_idx(zone) == ZONE_DEVICE) {
> + if (zone_is_zone_device(zone)) {
> if (!IS_ALIGNED(start_pfn, PAGES_PER_SECTION))
> section_taint_zone_device(start_pfn);
> if (!IS_ALIGNED(start_pfn + nr_pages, PAGES_PER_SECTION))
>
>
> .
>
Reviewed-by: Miaohe Lin
We always memset the zspage allocated via cache_alloc_zspage. So it's more
convenient to use kmem_cache_zalloc in cache_alloc_zspage than caller do it
manually.
Signed-off-by: Miaohe Lin
---
mm/zsmalloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/zsmalloc.c b/mm
When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding
and releasing hugetlb_lock.
Signed-off-by: Miaohe Lin
---
mm/hugetlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 737b2dce19e6..fe2da9ad6233 100644
--- a/mm
Since commit a5516438959d ("hugetlb: modular state for hugetlb page size"),
we can use huge_page_order to access hstate->order and pages_per_huge_page
to fetch the pages per huge page. But gather_bootmem_prealloc() forgot to
use it.
Signed-off-by: Miaohe Lin
---
mm/hugetlb.c | 4
is
verified with ATTR_SIZE.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 740693d7f255..9b221b87fbea 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -755,10
Since commit e5ff215941d5 ("hugetlb: multiple hstates for multiple page
sizes"), we can use macro default_hstate to get the struct hstate which
we use by default. But init_hugetlbfs_fs() forgot to use it.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 2 +-
1 file changed, 1
The func do_generic_mapping_read() is killed by commit 36e789144267 ("kill
do_generic_mapping_read"). So replace it with do_generic_mapping_read to
keep comment uptodate.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
The variable avoid_reserve is meaningless because we never changed its
value and just passed it to alloc_huge_page(). So remove it to make code
more clear that in hugetlbfs_fallocate, we never avoid reserve when alloc
hugepage yet.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 3 +--
1
Hi:
On 2021/1/16 17:36, Souptick Joarder wrote:
> On Sat, Jan 16, 2021 at 3:03 PM Miaohe Lin wrote:
>>
>> The func do_generic_mapping_read() is killed by commit 36e789144267 ("kill
>> do_generic_mapping_read"). So replace it with do_generic_mapping_read to
>&g
Hi:
On 2021/1/18 15:59, Muchun Song wrote:
> On Sat, Jan 16, 2021 at 5:11 PM Miaohe Lin wrote:
>>
>> When we reach here with inode = NULL, we should have crashed as inode has
>> already been dereferenced via hstate_inode. In order to make BUG_ON(!inode)
>> ta
generic_mapping_read() with
generic_file_buffered_read() to keep comment uptodate.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 23ad6ed8b75f..d02616513b43 100644
--- a/fs/hugetl
If list_lru_shrink_count is 0, we always return SHRINK_EMPTY regardless of
the value of max_nodes. So we can return early if nodes == 0 to save some
cpu cycles of approximating a reasonable limit for the nodes.
Signed-off-by: Miaohe Lin
---
mm/workingset.c | 5 ++---
1 file changed, 2
scalability problem. So
replace spinlock with rwsem to make comment uptodate.
Signed-off-by: Miaohe Lin
---
mm/rmap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/rmap.c b/mm/rmap.c
index e26ae119a131..f6f43620cd97 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -168,
Commit 108bcc96ef70 ("mm: add & use zone_end_pfn() and zone_spans_pfn()")
introduced the helper zone_end_pfn() to calculate the zone end pfn. But
pagetypeinfo_showmixedcount_print forgot to use it. And the initialization
of local variable pfn is duplicated, remove one.
Signed-off-
in coalesce_file_region case, we should
release one css reference before coalescence. Also only put css reference
when the entire file_region is removed.
Fixes: 075a61d07a8e ("hugetlb_cgroup: add accounting for shared mappings")
Signed-off-by: Miaohe Lin
Cc: sta...@kernel.org
---
inc
Hi:
On 2021/1/22 3:00, Mike Kravetz wrote:
> On 1/20/21 1:23 AM, Miaohe Lin wrote:
>> The calculation 1U << (h->order + PAGE_SHIFT - 10) is actually equal to
>> (PAGE_SHIFT << (h->order)) >> 10. So we can make it more readable by
>> replace it wit
+++ b/mm/zswap.c
> @@ -1272,6 +1272,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t
> offset,
> dst = kmap_atomic(page);
> zswap_fill_page(dst, entry->value);
> kunmap_atomic(dst);
> + ret = 0;
> goto freeentry;
> }
>
>
> base-commit: bc085f8fc88fc16796c9f2364e2bfb3fef305cad
>
Reviewed-by: Miaohe Lin
able_pages(unsigned long start,
> unsigned long end,
> if (!PageHuge(page))
> continue;
> head = compound_head(page);
> - if (page_huge_active(head))
> + /*
> + * This test is racy as we hold no reference or lock. The
> + * hugetlb page could have been free'ed and head is no longer
> + * a hugetlb page before the following check. In such unlikely
> + * cases false positives and negatives are possible.
> + */
Is it necessary to mention that: "offline_pages() could handle these racy
cases." in the comment ?
> + if (HPageMigratable(head))
> goto found;
> skip = compound_nr(head) - (page - head);
> pfn += skip - 1;
>
Looks good to me. Thanks.
Reviewed-by: Miaohe Lin
Hi Andrew:
On 2021/1/14 10:51, Miaohe Lin wrote:
> Hi:
> On 2021/1/11 1:14, Andi Kleen wrote:
>> On Sat, Jan 09, 2021 at 03:01:18AM -0500, Miaohe Lin wrote:
>>> Since commit 42e4089c7890 ("x86/speculation/l1tf: Disallow non privileged
>>> high MMIO PROT_NONE ma
Hi:
On 2021/1/22 13:02, Mike Kravetz wrote:
> On 1/21/21 5:42 PM, Miaohe Lin wrote:
>> Hi:
>> On 2021/1/22 3:00, Mike Kravetz wrote:
>>> On 1/20/21 1:23 AM, Miaohe Lin wrote:
>>>> The calculation 1U << (h->order + PAGE_SHIFT - 10) is actually equal to
The calculation 1U << (h->order + PAGE_SHIFT - 10) is actually equal to
(PAGE_SHIFT << (h->order)) >> 10. So we can make it more readable by
replace it with huge_page_size(h) >> 10.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 4 ++--
1 file changed
this.
Reviewed-by: David Hildenbrand
Signed-off-by: Miaohe Lin
Cc: Mike Kravetz
---
fs/hugetlbfs/inode.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 4bbfd78a7ccb..14df2f73b8ef 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs
oreReserve(new_page);
>
> /* Break COW */
> huge_ptep_clear_flush(vma, haddr, ptep);
> @@ -4279,7 +4278,7 @@ int huge_add_to_page_cache(struct page *page, struct
> address_space *mapping,
>
> if (err)
> return err;
> - ClearPagePrivate(page);
> + ClearHPageRestoreReserve(page);
>
> /*
>* set page dirty so that it will not be removed from cache/file
> @@ -4441,7 +4440,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
> goto backout;
>
> if (anon_rmap) {
> - ClearPagePrivate(page);
> + ClearHPageRestoreReserve(page);
> hugepage_add_new_anon_rmap(page, vma, haddr);
> } else
> page_dup_rmap(page, true);
> @@ -4755,7 +4754,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
> if (vm_shared) {
> page_dup_rmap(page, true);
> } else {
> - ClearPagePrivate(page);
> + ClearHPageRestoreReserve(page);
> hugepage_add_new_anon_rmap(page, dst_vma, dst_addr);
> }
>
>
Looks good to me.Thanks.
Reviewed-by: Miaohe Lin
Hi:
On 2021/1/20 2:41, Mike Kravetz wrote:
> Please CC Andrew on hugetlb patches as they need to go through his tree.
>
> On 1/16/21 1:26 AM, Miaohe Lin wrote:
>> The variable avoid_reserve is meaningless because we never changed its
>> value and just passed it to alloc_h
We can simplify the zhdr initialization by memset() the zhdr first instead
of set struct member to zero one by one. This would also make code more
compact and clear.
Signed-off-by: Miaohe Lin
---
mm/z3fold.c | 8 +---
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/mm/z3fold.c
Since commit dcf5aedb24f8 ("z3fold: stricter locking and more careful
reclaim"), release_z3fold_page() is used again. So we can drop the unused
attribute safely.
Signed-off-by: Miaohe Lin
---
mm/z3fold.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/z3f
The calculation 1U << (h->order + PAGE_SHIFT - 10) is actually equal to
(PAGE_SHIFT << (h->order)) >> 10. So we can make it more readable by
replace it with huge_page_size(h) / SZ_1K.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 4 ++--
1 file changed, 2 in
rface")
Signed-off-by: Miaohe Lin
Cc:
---
mm/hugetlb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e249bffa0e75..91a2a2025a2c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2947,8 +2947,10 @@ static int hugetlb_sysfs_add_hstate(str
The huge page size is encoded for VM_FAULT_HWPOISON errors only. So if we
return VM_FAULT_HWPOISON, huge page size would just be ignored.
Fixes: aa50d3a7aa81 ("Encode huge page size for VM_FAULT_HWPOISON errors")
Signed-off-by: Miaohe Lin
Cc:
---
mm/hugetlb.c | 2 +-
1 file
Luo
Signed-off-by: Miaohe Lin
Cc:
---
mm/vmalloc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 6507a579ff88..8ab83fbecadd 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2421,8 +2421,10 @@ void *vmap(struct page **pages, un
On 2021/1/8 7:15, Andrew Morton wrote:
> On Thu, 7 Jan 2021 11:59:38 -0800 Mike Kravetz
> wrote:
>
>> On 1/7/21 4:32 AM, Miaohe Lin wrote:
>>> In hugetlb_sysfs_add_hstate(), we would do kobject_put() on hstate_kobjs
>>> when failed to create sysfs group but f
Hi:
On 2021/1/15 3:16, Mike Kravetz wrote:
> On 1/14/21 4:32 AM, David Hildenbrand wrote:
>> On 14.01.21 12:31, Miaohe Lin wrote:
>>> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding
>>> and releasing hugetlb_lock.
>>
>> So,
Hi:
On 2021/1/10 1:40, Matthew Wilcox wrote:
> On Sat, Jan 09, 2021 at 03:09:43AM -0500, Miaohe Lin wrote:
>> The cache->slots and cache->slots_ret is already checked before we try to
>> drain it. And kvfree can handle the NULL pointer itself. So remove the
>&
Hi:
On 2021/1/11 1:14, Andi Kleen wrote:
> On Sat, Jan 09, 2021 at 03:01:18AM -0500, Miaohe Lin wrote:
>> Since commit 42e4089c7890 ("x86/speculation/l1tf: Disallow non privileged
>> high MMIO PROT_NONE mappings"), when the first pfn modify is not allowed,
>> w
-by: David Hildenbrand
Signed-off-by: Miaohe Lin
---
mm/hugetlb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4f67f6b159c7..da064cb8fd53 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3591,6 +3591,9 @@ static int hugetlb_acct_memory(struct hstate *h
Hi:
On 2021/1/15 17:28, Oscar Salvador wrote:
> On Fri, Jan 15, 2021 at 04:20:13AM -0500, Miaohe Lin wrote:
>> When gbl_reserve is 0, hugetlb_acct_memory() will do nothing except holding
>> and releasing hugetlb_lock. We should avoid this unnecessary hugetlb_lock
>> lo
Hi:
On 2021/1/24 10:01, Andrew Morton wrote:
> On Fri, 22 Jan 2021 16:27:23 +0800 Miaohe Lin wrote:
>
>> Hi Andrew:
>> On 2021/1/14 10:51, Miaohe Lin wrote:
>>> Hi:
>>> On 2021/1/11 1:14, Andi Kleen wrote:
>>>> On Sat, Jan 09, 2021 at 03:01:
__init register_page_bootmem_info_node(struct pglist_data *pgdat)
> -{
> - unsigned long i, pfn, end_pfn, nr_pages;
> - int node = pgdat->node_id;
> - struct page *page;
> -
> - nr_pages = PAGE_ALIGN(sizeof(struct pglist_data)) >> PAGE_SHIFT;
> - page = virt_to_page(pgdat);
> -
> - for (i = 0; i < nr_pages; i++, page++)
> - get_page_bootmem(node, page, NODE_INFO);
> -
> - pfn = pgdat->node_start_pfn;
> - end_pfn = pgdat_end_pfn(pgdat);
> -
> - /* register section info */
> - for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
> - /*
> - * Some platforms can assign the same pfn to multiple nodes - on
> - * node0 as well as nodeN. To avoid registering a pfn against
> - * multiple nodes we check that this pfn does not already
> - * reside in some other nodes.
> - */
> - if (pfn_valid(pfn) && (early_pfn_to_nid(pfn) == node))
> - register_page_bootmem_info_section(pfn);
> - }
> -}
> -#endif /* CONFIG_HAVE_BOOTMEM_INFO_NODE */
> -
> static int check_pfn_span(unsigned long pfn, unsigned long nr_pages,
> const char *reason)
> {
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 7bd23f9d6cef..87676bf3af40 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -13,6 +13,7 @@
> #include
> #include
> #include
> +#include
>
> #include "internal.h"
> #include
>
Huge but straightforward change. This patchset would do a big deal.
Looks good to me. Thanks.
Reviewed-by: Miaohe Lin
en)
> iocb->ki_flags |= IOCB_NOWAIT;
>
> - i = 0;
> pg_nr = generic_file_buffered_read_get_pages(iocb, iter,
> pages, nr_pages);
> if (pg_nr < 0) {
>
Reviewed-by: Miaohe Lin
e(page, current->mm, gfp);
> if (error)
> goto error;
> + charged = true;
> }
>
> gfp &= GFP_RECLAIM_MASK;
> @@ -896,6 +898,8 @@ noinline int __add_to_page_cache_locked(struct page *page,
>
> if (xas_error()) {
> error = xas_error();
> + if (charged)
> + mem_cgroup_uncharge(page);
> goto error;
> }
>
>
Looks good to me. Thanks.
Reviewed-by: Miaohe Lin
Hi:
On 2021/1/25 12:36, Matthew Wilcox wrote:
> On Sun, Jan 24, 2021 at 11:24:41PM -0500, Waiman Long wrote:
>> diff --git a/mm/filemap.c b/mm/filemap.c
>> index 5c9d564317a5..aa0e0fb04670 100644
>> --- a/mm/filemap.c
>> +++ b/mm/filemap.c
>> @@ -835,6 +835,7 @@ noinline int
When we reach here with inode = NULL, we should have crashed as inode has
already been dereferenced via hstate_inode. So this BUG_ON(!inode) does not
take effect and should be removed.
Signed-off-by: Miaohe Lin
---
fs/hugetlbfs/inode.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs
t;)
Signed-off-by: Miaohe Lin
---
net/core/sock.c | 25 +++--
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index 49cd5ffe673e..c9083ad44ea1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3406,6 +3406,16 @@ s
The skb_shared_info part of the data is assigned in the following loop. It
is meaningless to do a memcpy here.
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7e2e502ef519..5b983c9472f5 100644
field. So
we reword the comment as this would be helpful.
[Thanks Michal Hocko for rewording this comment.]
Signed-off-by: Miaohe Lin
Cc: Johannes Weiner
Cc: Michal Hocko
Cc: Vladimir Davydov
---
mm/memcontrol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memcont
If we failed to drain inode, we would forget to free the swap address space
allocated by init_swap_address_space() above.
Fixes: dc617f29dbe5 ("vfs: don't allow writes to swap files")
Signed-off-by: Miaohe Lin
---
mm/swapfile.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletio
It's unnecessary to goto the out label while out label is just below.
Signed-off-by: Miaohe Lin
---
mm/swapfile.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4522b458a814..edc96e83c372 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1182,7 +1182,6
Rework the list_add code to make it more readable and simplicity.
Signed-off-by: Miaohe Lin
---
mm/zsmalloc.c | 11 ---
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 918c7b019b3d..b03bee2e1b5f 100644
--- a/mm/zsmalloc.c
+++ b/mm
When the code went to the out label, it must have p == NULL. So what out
label really does is redundant if check and return err. We should Remove
this unnecessary out label because it does not handle resource free and so
on.
Signed-off-by: Miaohe Lin
---
mm/swapfile.c | 5 ++---
1 file changed
swap_ra_info() may leave ra_info untouched in non_swap_entry() case as page
table lock is not held. In this case, we have ra_info.nr_pte == 0 and it is
meaningless to continue with swap cache readahead. Skip such ops by init
ra_info.win = 1.
Signed-off-by: Miaohe Lin
---
mm/swap_state.c | 2
Commit 570a335b8e22 ("swap_info: swap count continuations") introduced the
func add_swap_count_continuation() but forgot to use the helper function
swap_count() introduced by commit 355cfa73ddff ("mm: modify swap_map and
add SWAP_HAS_CACHE flag").
Signed-off-by: Miaohe Lin
--
The mz->usage_in_excess >= mz_node->usage_in_excess check is exactly the
else case of mz->usage_in_excess < mz_node->usage_in_excess. So we could
replace else if (mz->usage_in_excess >= mz_node->usage_in_excess) with else
equally.
Signed-off-by: Miaohe Lin
---
mm/
They are unused anymore.
Signed-off-by: Miaohe Lin
---
include/linux/page-flags.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 4f6ba9379112..50cbf5e931bc 100644
--- a/include/linux/page-flags.h
+++ b/include
really explain much.
Acked-by: Michal Hocko
Signed-off-by: Miaohe Lin
---
mm/memcontrol.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2636f8bad908..b080a9434b9e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6
Since commit fb2a6fc56be6 ("mm: memcg: rework and document OOM waiting and
wakeup"), we have renamed mem_cgroup_oom_lock to mem_cgroup_oom_trylock. So
replace mem_cgroup_oom_lock with mem_cgroup_oom_trylock in comment.
Signed-off-by: Miaohe Lin
---
mm/memcontrol.c | 2 +-
1 file
_oom field.
Signed-off-by: Miaohe Lin
---
mm/memcontrol.c | 4
1 file changed, 4 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index cd5f83de9a6f..e44f5afaf78b 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1848,10 +1848,6 @@ static void mem_cgroup_unmark_under_oom(struct
Since commit bbec2e15170a ("mm: rename page_counter's count/limit into
usage/max"), page_counter_limit() is renamed to page_counter_set_max().
So replace page_counter_limit with page_counter_set_max in comment.
Signed-off-by: Miaohe Lin
---
mm/page_counter.c | 2 +-
1 file changed, 1
_link_file().
Signed-off-by: Miaohe Lin
---
kernel/fork.c | 2 +-
mm/mmap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 11ed5ac35caf..b9164b75b20c 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -558,7 +558,7 @@ static __latent_entropy in
Cache the swap_node() in a local variable to avoid possible multiple call
to swap_node(), though compiler may do this for us.
Signed-off-by: Miaohe Lin
---
mm/swapfile.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 20012c0c0252
Fix some comments, including wrong function name, duplicated word and so
on.
Signed-off-by: Miaohe Lin
---
include/linux/skbuff.h | 4 ++--
include/uapi/linux/in.h | 2 +-
net/core/sock.c | 2 +-
net/ipv4/raw.c | 2 +-
net/l3mdev/l3mdev.c | 2 +-
net/socket.c
skb_checksum_setup_ipv6() always return -EPROTO if ipv6 packet is fragment.
So we should not continue to parse other header type in this case. Also
remove unnecessary local variable 'fragment'.
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 12 ++--
1 file changed, 6 insertions(+), 6
In the case of off = 0, skb_headers_offset_update() do nothing indeed.
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 18ed56316e56..f67f0da20a5b 100644
--- a/net/core/skbuff.c
+++ b/net/core
When skbuff is fragment, we exit immediately and leave ip_hdrlen() as
unused. And remove the unnecessary local variable fragment.
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/net/core/skbuff.c b/net/core
Add else to split mutually exclusive case and avoid unnecessary check.
Signed-off-by: Miaohe Lin
---
net/ipv4/ping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 19a947bf0faa..265676fd2bbd 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4
Set trailer iff skb1 is the skbuff where the tailbits space begins.
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 0b24aed04060..18ed56316e56 100644
--- a/net/core/skbuff.c
+++ b
if UDP or RAW uarg is newly
allocated when the skb is zcopied.
Fixes: 522924b58308 ("net: correct udp zerocopy refcnt also when zerocopy only
on append")
Signed-off-by: Miaohe Lin
---
net/ipv4/ip_output.c | 4 +++-
net/ipv6/ip6_output.c | 4 +++-
2 files changed, 6 insertions(+), 2
If the skb is zcopied, we should increase the skb_uarg refcount before we
involve skb_release_data(). See pskb_expand_head() as a reference.
Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
Signed-off-by: Miaohe Lin
---
net/core/skbuff.c | 2 ++
1 file changed, 2
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
kernel/futex.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/futex.c b/kernel/futex.c
index 83404124b77b..5310dc330656 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
fs/locks.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/locks.c b/fs/locks.c
index 938fe325bc54..32c948fe2944 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1499,7 +1499,7
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index 6f16f7c5d375..27505ca5be2d 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
kernel/sys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index ca11af9d815d..ab6c409b1159 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1753,7
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
kernel/bpf/cgroup.c | 2 +-
kernel/bpf/cpumap.c | 2 +-
kernel/bpf/syscall.c | 2 +-
kernel/bpf/verifier.c | 6 +++---
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/bpf
Since commit 8d7017fd621d ("blackhole_netdev: use blackhole_netdev to
invalidate dst entries"), we use blackhole_netdev to invalidate dst entries
instead of loopback device anymore.
Signed-off-by: Miaohe Lin
---
net/core/dst.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Remove the weird space inside the NETIF_F_CSUM_MASK.
Signed-off-by: Miaohe Lin
---
include/linux/netdev_features.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 2cc3cf80b49a..0b17c4322b09 100644
Thumshirn
Signed-off-by: Miaohe Lin
---
block/bio.c | 12 +++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/block/bio.c b/block/bio.c
index e113073958cb..a323a5446221 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1080,7 +1080,7 @@ static int __bio_iov_append_get_pages(
Fix some weird and confusing comments.
Signed-off-by: Miaohe Lin
---
lib/checksum.c | 2 +-
lib/refcount.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/checksum.c b/lib/checksum.c
index c7861e84c526..cd0175c6a355 100644
--- a/lib/checksum.c
+++ b/lib/checksum.c
Correct the wrong param name @addr to @p.
Signed-off-by: Miaohe Lin
---
include/asm-generic/bitops/lock.h | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/asm-generic/bitops/lock.h
b/include/asm-generic/bitops/lock.h
index 3ae021368f48..cdd4fde2dacc 100644
No functional change intended.
Signed-off-by: Miaohe Lin
---
kernel/signal.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index a38b3edc6851..10a31fafc35b 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1115,8 +1115,8
t;)
Signed-off-by: Miaohe Lin
---
block/bio.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/block/bio.c b/block/bio.c
index a9931f23d933..e113073958cb 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1023,7 +1023,7 @@ static int __bio_iov_iter_get_pages(struc
mempool_alloc() may return NULL if __GFP_DIRECT_RECLAIM is not set in
gfp_mask under memory pressure. So we should check the return value of
mempool_alloc() against NULL before dereference.
Fixes: a892c8d52c02 ("block: Inline encryption support for blk-mq")
Signed-off-by: Miaohe Lin
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
net/dccp/ccids/ccid3.c | 2 +-
net/dccp/feat.c| 3 ++-
net/dccp/input.c | 10 +-
net/dccp/options.c | 2 +-
net/dccp/output.c | 8
net/dccp/proto.c | 8
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
net/sunrpc/auth_gss/gss_krb5_wrap.c | 2 +-
net/sunrpc/clnt.c | 22 +++---
net/sunrpc/xprt.c | 2 +-
net/sunrpc/xprtrdma/verbs.c | 2
Convert the uses of fallthrough comments to fallthrough macro.
Signed-off-by: Miaohe Lin
---
net/wireless/chan.c| 4 ++--
net/wireless/mlme.c| 2 +-
net/wireless/nl80211.c | 20 ++--
net/wireless/scan.c| 2 +-
net/wireless/sme.c | 4
There is no need to fetch errno and fatal info from icmp_err_convert when
icmp code is ICMP_FRAG_NEEDED.
Signed-off-by: Miaohe Lin
---
net/ipv4/raw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 6fd4330287c2..ea4c36e93824 100644
When mtu is locked, we should not obtain ipv4 mtu as we return immediately
in this case and leave acquired ipv4 mtu unused.
Signed-off-by: Miaohe Lin
---
net/ipv4/route.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 8ca6bcab7b03
Use helper macro RT_TOS() to get tos in __icmp_send().
Signed-off-by: Miaohe Lin
---
net/ipv4/icmp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index cf36f955bfe6..3b387dc3864f 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
Add else to split mutually exclusive case and avoid some unnecessary check.
Signed-off-by: Miaohe Lin
---
mm/mempool.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/mm/mempool.c b/mm/mempool.c
index 79bff63ecf27..73fb2e548b43 100644
--- a/mm/mempool.c
+++ b/mm
Use helper function mapping_allow_writable() to atomic_inc i_mmap_writable.
Signed-off-by: Miaohe Lin
---
kernel/fork.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/fork.c b/kernel/fork.c
index 4b328aecabb2..a0586716e327 100644
--- a/kernel/fork.c
+++ b/kernel
Use helper function allow_write_access() to atomic_inc the i_writecount.
Signed-off-by: Miaohe Lin
---
mm/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 80ea11bf12fa..a22f1a2fc82e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -143,7 +143,7
Since commit bbec2e15170a ("mm: rename page_counter's count/limit into
usage/max"), the arg @reclaim has no priority field anymore.
Signed-off-by: Miaohe Lin
---
mm/memcontrol.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontr
Since commit 9da83f3fc74b ("mm, memcg: clean up reclaim iter array"), the
arg @reclaim has no priority field anymore.
Signed-off-by: Miaohe Lin
---
mm/memcontrol.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 75
Fix some broken comments including typo, grammar error and wrong function
name.
Signed-off-by: Miaohe Lin
---
mm/filemap.c| 4 ++--
mm/swap_state.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 585278d13d96..ac04738bf11b 100644
The description of arg flags is incomplete. The flags is saved IRQ-flags
when the @lock is acquired.
Signed-off-by: Miaohe Lin
---
lib/refcount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/refcount.c b/lib/refcount.c
index ebac8b7d15a7..dcfd092f66c7 100644
--- a/lib
In commit 1da177e4c3f4 ("Linux-2.6.12-rc2"), the helper allow_write_access
came with the atomic_inc operation of the i_writecount field in the func
__remove_shared_vm_struct(). But it forgot to use this helper function.
Signed-off-by: Miaohe Lin
---
mm/mmap.c | 2 +-
1 file changed, 1
The description of arg flags is incomplete. The flags is saved IRQ-flags
when the @lock is acquired.
Acked-by: Will Deacon
Signed-off-by: Miaohe Lin
---
lib/refcount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/refcount.c b/lib/refcount.c
index ebac8b7d15a7
We could use helper memset to fill the swap_map with SWAP_HAS_CACHE instead
of a direct loop here to simplify the code. Also we can remove the local
variable i and map this way.
Signed-off-by: Miaohe Lin
---
mm/swapfile.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git
led to catch this case and always fput() the
original file, hence add an extra fput().
[ Thanks Hillf for pointing this extra fput() out. ]
Fixes: d70cec898324 ("mm: mmap: merge vma after call_mmap() if possible")
Reported-by: syzbot+c5d5a51dcbb558ca0...@syzkaller.appspotmail.com
Signed-off-by
Use helper macro abs() to simplify the "x > t || x < -t" cmp.
Signed-off-by: Miaohe Lin
---
mm/vmstat.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 06fd13ebc2b8..648c2d6ddce2 100644
--- a/mm/vmstat.c
+++ b/mm/vm
Since commit 07d802699528 ("mm: devmap: refactor 1-based refcounting for
ZONE_DEVICE pages"), we have renamed the func put_devmap_managed_page() to
page_is_devmap_managed().
Signed-off-by: Miaohe Lin
---
mm/swap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/m
1 - 100 of 433 matches
Mail list logo