From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: [merged] mm-do_swap_page-fix-up-the-error-code-instantiation.patch removed from -mm tree Date: Fri, 26 Jun 2020 20:33:01 -0700 Message-ID: <20200627033301.1BT1AdulH%akpm@linux-foundation.org> References: <20200625202807.b630829d6fa55388148bee7d@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:44696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgF0DdC (ORCPT ); Fri, 26 Jun 2020 23:33:02 -0400 In-Reply-To: <20200625202807.b630829d6fa55388148bee7d@linux-foundation.org> Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: alex.shi@linux.alibaba.com, guro@fb.com, hannes@cmpxchg.org, hughd@google.com, js1304@gmail.com, kirill@shutemov.name, mhocko@suse.com, mm-commits@vger.kernel.org, shakeelb@google.com The patch titled Subject: mm: do_swap_page(): fix up the error code has been removed from the -mm tree. Its filename was mm-do_swap_page-fix-up-the-error-code-instantiation.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Michal Hocko Subject: mm: do_swap_page(): fix up the error code do_swap_page() returns error codes from the VM_FAULT* space. try_charge() might return -ENOMEM, though, and then do_swap_page() simply returns 0 which means a success. We almost never return ENOMEM for GFP_KERNEL single page charge. Except for async OOM handling (oom_disabled v1). So this needs translation to VM_FAULT_OOM otherwise the the page fault path will not notify the userspace and wait for an action. Link: http://lkml.kernel.org/r/20200617090238.GL9499@dhcp22.suse.cz Fixes: 4c6355b25e8b ("mm: memcontrol: charge swapin pages on instantiation") Signed-off-by: Michal Hocko Acked-by: Johannes Weiner Cc: Alex Shi Cc: Joonsoo Kim Cc: Shakeel Butt Cc: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Roman Gushchin Signed-off-by: Andrew Morton --- mm/memory.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/mm/memory.c~mm-do_swap_page-fix-up-the-error-code-instantiation +++ a/mm/memory.c @@ -3140,8 +3140,10 @@ vm_fault_t do_swap_page(struct vm_fault err = mem_cgroup_charge(page, vma->vm_mm, GFP_KERNEL); ClearPageSwapCache(page); - if (err) + if (err) { + ret = VM_FAULT_OOM; goto out_page; + } lru_cache_add(page); swap_readpage(page, true); _ Patches currently in -mm which might be from mhocko@suse.com are