Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1365607imm; Tue, 3 Jul 2018 09:51:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd4FCjKKI2RFwTZ2h8p2nltow3g3a8A7BElT+N7QPzoxtd6EzG2jOQ0w2ywr2LmDARYjEtN X-Received: by 2002:a65:52cc:: with SMTP id z12-v6mr17025265pgp.69.1530636706393; Tue, 03 Jul 2018 09:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530636706; cv=none; d=google.com; s=arc-20160816; b=grHX1T8XS8rKNjuaLxukLJU9oM3Sw0FjMy2d9VP2rPcVxZWy7wvPI8n0q4iQhR6kOF XYku9XbjjQcO9r26ABDwA0/FFxuleePZI4/pjuGR5Vw+A32mI68Ov2xQapoHbbqePAXf N7au0uuadFxO3hNBhQ6AaTTACZfGY4WdSkXrb1RCcwU53flgfEN1C9Tz9hTvIlcD1JPD Y1QbWVed+INqsM/XMG6DKbmHa2hR6VQmU33u2bPkW0CzkDnjVfJiH3bjpcYPHJalnyA6 evvHOy/pqkcqD0b683dTK0r5bgz4PSu34Sv71E6QK4ES5MNSynMMh74eAO4z7nGbBpo/ pULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=wtUMma7zw/yVjuqCD+nOEgJCEoQb23gMXiRNwb9r+xY=; b=AnCSmWYF8iduSOwOiwxgBXJX+nDVULatukOCFUboPtJw6fHsvN09arXCuEI0dvS8zJ gXo6eCFdKETqZzkO7tKy+twz7+MY/i/6TP1210z5xrfqZYrNC3CLi6nXBtZjKmoVdLPp arTUKqTfJRAd+bDuUIet57qfYw/BMhE/kE51aHgAI+O70k2yU1PsvxRq9uwbDG+y3ygd WCZCPS/UJq0WRIoxlzkYyDkvSC/wjClGI5oD3ob834vTxwl7c+Hm9A8ghCE2pR4xAiAn NPvzRMu1XuciVCbZKaNiS7xUF39RhZDzWnFgtFlbUhx1cWEFZSjnn7IumqeqdZUqzYMr WOoQ== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si1419477plc.415.2018.07.03.09.51.31; Tue, 03 Jul 2018 09:51:46 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933983AbeGCQuu (ORCPT + 99 others); Tue, 3 Jul 2018 12:50:50 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:45964 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933569AbeGCQut (ORCPT ); Tue, 3 Jul 2018 12:50:49 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R611e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07417;MF=yang.shi@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0T3vavFn_1530636621; Received: from US-143344MP.local(mailfrom:yang.shi@linux.alibaba.com fp:SMTPD_---0T3vavFn_1530636621) by smtp.aliyun-inc.com(127.0.0.1); Wed, 04 Jul 2018 00:50:27 +0800 Subject: Re: [RFC v3 PATCH 5/5] x86: check VM_DEAD flag in page fault To: Michal Hocko 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 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> <20180703061713.GB16767@dhcp22.suse.cz> From: Yang Shi Message-ID: <472ce7f9-be53-c741-6bad-f46ec9dfbb8a@linux.alibaba.com> Date: Tue, 3 Jul 2018 09:50:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180703061713.GB16767@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/2/18 11:17 PM, Michal Hocko wrote: > 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. Sorry, this is a typo, it should be "shared". > 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). Yes, sure. I think I got your point. Thanks for the elaboration. Yang >