Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbdIEPyg (ORCPT ); Tue, 5 Sep 2017 11:54:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53075 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbdIEPyf (ORCPT ); Tue, 5 Sep 2017 11:54:35 -0400 Subject: Re: [PATCH] mm: Fix mem_cgroup_oom_disable() call missing To: "Kirill A. Shutemov" , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1504625439-31313-1-git-send-email-ldufour@linux.vnet.ibm.com> <20170905154650.c3xiwp52btcckjr4@node.shutemov.name> From: Laurent Dufour Date: Tue, 5 Sep 2017 17:54:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170905154650.c3xiwp52btcckjr4@node.shutemov.name> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17090515-0020-0000-0000-000003B3C59F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17090515-0021-0000-0000-000042442FCF Message-Id: <73199b41-da7d-2bd5-6214-da55ab62cea9@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-05_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709050228 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 965 Lines: 30 On 05/09/2017 17:46, Kirill A. Shutemov wrote: > On Tue, Sep 05, 2017 at 05:30:39PM +0200, Laurent Dufour wrote: >> Seen while reading the code, in handle_mm_fault(), in the case >> arch_vma_access_permitted() is failing the call to mem_cgroup_oom_disable() >> is not made. >> >> To fix that, move the call to mem_cgroup_oom_enable() after calling >> arch_vma_access_permitted() as it should not have entered the memcg OOM. >> >> Fixes: bae473a423f6 ("mm: introduce fault_env") >> Signed-off-by: Laurent Dufour > > Ouch. Sorry for this. > > Acked-by: Kirill A. Shutemov > > Cc: stable@ is needed too. Andrew, should I resent it with stable in copy ? > > It's strange we haven't seen reports of warning from > mem_cgroup_oom_enable(). AFAIU, arch_vma_access_permitted() is only defined for x86 and it is failing only in the case of the protection key mismatch, not so much used for now... Cheers, Laurent.