Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752226AbdLPHLV (ORCPT ); Sat, 16 Dec 2017 02:11:21 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12004 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbdLPHLS (ORCPT ); Sat, 16 Dec 2017 02:11:18 -0500 Subject: Re: [Question ]: Avoid kernel panic when killing an application if happen RAS page table error To: Matthew Wilcox , James Morse CC: "linux-mm@kvack.org" , Linux Kernel Mailing List , Huangshaoyu , Wuquanming , "linux-arm-kernel@lists.infradead.org" References: <0184EA26B2509940AA629AE1405DD7F2019C8B36@DGGEMA503-MBS.china.huawei.com> <20171205165727.GG3070@tassilo.jf.intel.com> <0276f3b3-94a5-8a47-dfb7-8773cd2f99c5@huawei.com> <0b7bb7b3-ae39-0c97-9c0a-af37b0701ab4@huawei.com> <5A3419F3.1030804@arm.com> <20171215193551.GD27160@bombadil.infradead.org> From: gengdongjiu Message-ID: <42ebc814-fd8d-0de5-5c3c-e2eec02ebf66@huawei.com> Date: Sat, 16 Dec 2017 15:09:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171215193551.GD27160@bombadil.infradead.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.68.147] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5A34C6C4.005C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 19620f3183714cfd70f540a8205c1bbe Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 957 Lines: 19 On 2017/12/16 3:35, Matthew Wilcox wrote: >> It's going to be complicated to do, I don't think its worth the effort. > We can find a bit in struct page that we guarantee will only be set if > this is allocated as a pagetable. Bit 1 of the third union is currently > available (compound_head is a pointer if bit 0 is set, so nothing is > using bit 1). We can put a pointer to the mm_struct in the same word. > > Finding all the allocated pages will be the tricky bit. We could put a > list_head into struct page; perhaps in the same spot as page_deferred_list > for tail pages. Then we can link all the pagetables belonging to > this mm together and tear them all down if any of them get an error. > They'll repopulate on demand. It won't be quick or scalable, but when > the alternative is death, it looks relatively attractive. Thanks for the comments, I will check it in detailed and investigate whether it is worth to do for it. Thanks! > > . >