Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp787630imm; Mon, 2 Jul 2018 23:19:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIiehGyTWvzLniPDR19y0EW6iCq6Y3ZKmJ6id7w3HTxznmeFQuwrHcb7ere5aitmZpFPt0a X-Received: by 2002:a17:902:bcc3:: with SMTP id o3-v6mr28477453pls.336.1530598773615; Mon, 02 Jul 2018 23:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530598773; cv=none; d=google.com; s=arc-20160816; b=lA1jp0YjnBKBsc01lfQ5LedKeFOMnCbercpgpOSV7vgWjXUealPg8xy1tbKPPxLzuA 3coFFvDEnRV45+qz+Hhm4LRUsMqkk79jq/f6u7xMDJV3+7yUNENEgXWbs+++dPoqH6tI Wna2Zt+i9SXhT5YwqKsVwOvy1btNyiK+kyHe5CDGHsnJ6uiwlK1M98fWuY+B5jq3wWoV 8ZRuO0EiF4T9atA5d3cRkgKTcxQT8iOkFd50QjdVwvtXLUL5ruMS9nvBmgl4XiY3BP0d AEdGWusz8a1TO/IRB6ZLpdR5lTQkqbowN7sfoXBAbdJjQc9u1xItLFfn1gKzputfdLHp GyEA== 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=dG6N1D9YHYXqUX9FE8b4i7kOGWz9vpzo2bkG5pWovvo=; b=IfSt3x8TMPZB425VrV/ddchEteuwctV55ijk2KkioUWNrQZDZbnPdjKxuwnWGH0d4X S+9NT03rOtdiedm4O0r2YC2jjaJel29UJUnza1MI0eVgX1U/JpGFLsZ+lPo8XGwaln1Q Ixo0OMMsGaVbRPu54jBmFaoWjtl9j0GsGKEizL449kfGmGbOew2wCMoWamHthWciyOeM g/IRFUPA1PCNKONE5k6NLgxKXP6N95LYtDztjP19daoN2Nj22k6QGRPuw3Us+aCL1Dd2 ts6JfssnZY0/eocu1IIl97WQg/YVweuVlwYr6GeeadjO1Fjd4MDMte3MDKZNsCkhwDy8 DldA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26-v6si402869pfj.120.2018.07.02.23.19.18; Mon, 02 Jul 2018 23:19:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932915AbeGCGRQ (ORCPT + 99 others); Tue, 3 Jul 2018 02:17:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:57680 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932360AbeGCGRP (ORCPT ); Tue, 3 Jul 2018 02:17:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 05A16ADCC; Tue, 3 Jul 2018 06:17:14 +0000 (UTC) Date: Tue, 3 Jul 2018 08:17:13 +0200 From: Michal Hocko To: Yang Shi Cc: Laurent Dufour , willy@infradead.org, akpm@linux-foundation.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC v3 PATCH 5/5] x86: check VM_DEAD flag in page fault Message-ID: <20180703061713.GB16767@dhcp22.suse.cz> References: <1530311985-31251-6-git-send-email-yang.shi@linux.alibaba.com> <84eba553-2e0b-1a90-d543-6b22c1b3c5f8@linux.vnet.ibm.com> <20180702121528.GM19043@dhcp22.suse.cz> <80406cbd-67f4-ca4c-cd54-aeb305579a72@linux.vnet.ibm.com> <20180702124558.GP19043@dhcp22.suse.cz> <20180702133733.GU19043@dhcp22.suse.cz> <6fd4eb3d-ef66-7a37-4adb-05c22ac51d95@linux.alibaba.com> <20180702175749.GG19043@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 02-07-18 11:10:23, Yang Shi wrote: > On 7/2/18 10:57 AM, Michal Hocko wrote: [...] > > Why would you even care about shared mappings? > > Just thought about we are dealing with VM_DEAD, which means the vma will be > tore down soon regardless it is shared or non-shared. > > MMF_UNSTABLE doesn't care about !shared case. Let me clarify some more. MMF_UNSTABLE is there to prevent from unexpected page faults when the mm is torn down by the oom reaper. And oom reaper only cares about private mappings because we do not touch shared ones. Disk based shared mappings should be a non-issue for VM_DEAD because even if you race and refault a page back then you know it is the same one you have seen before. Memory backed shared mappings are a different story because you can get a fresh new page. oom_reaper doesn't care because it doesn't tear those down. You would have to but my primary point was that we already have MMF_UNSTABLE so all you need is to extend it to memory backed shared mappings (shmem and hugetlb). -- Michal Hocko SUSE Labs