Received: by 10.192.165.148 with SMTP id m20csp2382705imm; Sun, 22 Apr 2018 06:09:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx493RB8KCkkdw0WcqfZFnOdCLreGwVjxXNFiJO1WiMj64LKxpMU9n+6rNvPdle2+oB3oTo9n X-Received: by 10.98.159.129 with SMTP id v1mr16558398pfk.25.1524402599668; Sun, 22 Apr 2018 06:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524402599; cv=none; d=google.com; s=arc-20160816; b=u52f96HrkBiPpyYwA5/MK/y9vq4X0TdWjvT2HTTyHwof9T2i2w2PuX3/5ywcyyqQv7 Z5jjjkZQvNAC+EDeyhU/bDg5tA/Vts22Q8lPDvMA1wQr5el5cYQ/dvSMY3+c601p85dY HKqXd6ci89tdnIKsWAXVSdqeBhdB77ZNqSD1bglgrHGa84nhWzZXe48/EMOZO1X9E6h1 WL5avks9rSH3AnfiCfp1gaRJNCiwFvElXQFiRIqIkQUkL3RHN5OcJax27cDosocjphhj Ab7KEil9GsugVkY8gKvkOwnCkvcUg1YjXZT/H9A3JJymcdclIDIoRKsay5CgEY6LfQ05 gB1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=3QC0R1H8jXuUzDiSvctahv53PT10rqnO+hZYCqdr5IU=; b=P2WYsld58jbN8rNYaKdCY8MIkwJV0y+cUWxsQc1x86iM8yK+E8MhGlLYuRBItzd/hk a9sqcP4JlT7ODHvjbxehLq2iVBXBLHQuZvXQ0OVzLasknvrQC44JX4TnCwogES/ZF3AH SL6HuRECmX0JWDaXnkCNd29MZcMNgZdt27P0M8yzqPdSsr26FOMED95G9OeVHPtFRzuC NmcPDx50UCsWJuoh5S5tEQBgWaN1WEeRnrMyLfnOifluks6IbKwxH0vrFM6qRnFWKoZ4 erhr5cDMqQg10n0fhXFFqhTlbLfAuNJrncfuxyxWx7KuHxtcqSNIfLLO/HQ0oyqlnF0t RaQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m77si9523050pfk.56.2018.04.22.06.09.45; Sun, 22 Apr 2018 06:09:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751592AbeDVNIl (ORCPT + 99 others); Sun, 22 Apr 2018 09:08:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:53290 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeDVNIk (ORCPT ); Sun, 22 Apr 2018 09:08:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 680B1ABB4; Sun, 22 Apr 2018 13:08:39 +0000 (UTC) Date: Sun, 22 Apr 2018 07:08:36 -0600 From: Michal Hocko To: Tetsuo Handa Cc: rientjes@google.com, akpm@linux-foundation.org, aarcange@redhat.com, guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap Message-ID: <20180422130836.GH17484@dhcp22.suse.cz> References: <20180419063556.GK17484@dhcp22.suse.cz> <20180420082349.GW17484@dhcp22.suse.cz> <20180420124044.GA17484@dhcp22.suse.cz> <201804221248.CHE35432.FtOMOLSHOFJFVQ@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804221248.CHE35432.FtOMOLSHOFJFVQ@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 22-04-18 12:48:13, Tetsuo Handa wrote: > David Rientjes wrote: > > How have you tested this? > > > > I'm wondering why you do not see oom killing of many processes if the > > victim is a very large process that takes a long time to free memory in > > exit_mmap() as I do because the oom reaper gives up trying to acquire > > mm->mmap_sem and just sets MMF_OOM_SKIP itself. > > > > We can call __oom_reap_task_mm() from exit_mmap() (or __mmput()) before > exit_mmap() holds mmap_sem for write. Then, at least memory which could > have been reclaimed if exit_mmap() did not hold mmap_sem for write will > be guaranteed to be reclaimed before MMF_OOM_SKIP is set. That might be an alternative way but I am really wondering whether this is the simplest way forward. -- Michal Hocko SUSE Labs