From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752623AbbFNUHh (ORCPT ); Sun, 14 Jun 2015 16:07:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49329 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbbFNUHa (ORCPT ); Sun, 14 Jun 2015 16:07:30 -0400 Date: Sun, 14 Jun 2015 22:06:23 +0200 From: Oleg Nesterov To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andy Lutomirski , Andrew Morton , Denys Vlasenko , Brian Gerst , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , Linus Torvalds , Thomas Gleixner , Waiman Long Subject: Re: why do we need vmalloc_sync_all? Message-ID: <20150614200623.GB19582@redhat.com> References: <1434188955-31397-1-git-send-email-mingo@kernel.org> <20150613185828.GA32376@redhat.com> <20150614075943.GA810@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150614075943.GA810@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/14, Ingo Molnar wrote: > > * Oleg Nesterov wrote: > > > I didn't read v2 yet, but I'd like to ask a question. > > > > Why do we need vmalloc_sync_all()? > > > > It has a single caller, register_die_notifier() which calls it without > > any explanation. IMO, this needs a comment at least. > > Yes, it's used to work around crashes in modular callbacks: if the callbacks > happens to be called from within the page fault path, before the vmalloc page > fault handler runs, then we have a catch-22 problem. > > It's rare but not entirely impossible. But again, the kernel no longer does this? do_page_fault() does vmalloc_fault() without notify_die(). If it fails, I do not see how/why a modular DIE_OOPS handler could try to resolve this problem and trigger another fault. > > I am not sure I understand the changelog in 101f12af correctly, but at first > > glance vmalloc_sync_all() is no longer needed at least on x86, do_page_fault() > > no longer does notify_die(DIE_PAGE_FAULT). And btw DIE_PAGE_FAULT has no users. > > DIE_MNI too... > > > > Perhaps we can simply kill it on x86? > > So in theory we could still have it run from DIE_OOPS, and that could turn a > survivable kernel crash into a non-survivable one. I don't understand... But OK, my understanding of this magic is very limited, please forget. Thanks, Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) by kanga.kvack.org (Postfix) with ESMTP id BC0F36B0038 for ; Sun, 14 Jun 2015 16:07:31 -0400 (EDT) Received: by qcej3 with SMTP id j3so2355903qce.3 for ; Sun, 14 Jun 2015 13:07:31 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id iq7si10702004qcb.1.2015.06.14.13.07.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jun 2015 13:07:31 -0700 (PDT) Date: Sun, 14 Jun 2015 22:06:23 +0200 From: Oleg Nesterov Subject: Re: why do we need vmalloc_sync_all? Message-ID: <20150614200623.GB19582@redhat.com> References: <1434188955-31397-1-git-send-email-mingo@kernel.org> <20150613185828.GA32376@redhat.com> <20150614075943.GA810@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150614075943.GA810@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andy Lutomirski , Andrew Morton , Denys Vlasenko , Brian Gerst , Peter Zijlstra , Borislav Petkov , "H. Peter Anvin" , Linus Torvalds , Thomas Gleixner , Waiman Long On 06/14, Ingo Molnar wrote: > > * Oleg Nesterov wrote: > > > I didn't read v2 yet, but I'd like to ask a question. > > > > Why do we need vmalloc_sync_all()? > > > > It has a single caller, register_die_notifier() which calls it without > > any explanation. IMO, this needs a comment at least. > > Yes, it's used to work around crashes in modular callbacks: if the callbacks > happens to be called from within the page fault path, before the vmalloc page > fault handler runs, then we have a catch-22 problem. > > It's rare but not entirely impossible. But again, the kernel no longer does this? do_page_fault() does vmalloc_fault() without notify_die(). If it fails, I do not see how/why a modular DIE_OOPS handler could try to resolve this problem and trigger another fault. > > I am not sure I understand the changelog in 101f12af correctly, but at first > > glance vmalloc_sync_all() is no longer needed at least on x86, do_page_fault() > > no longer does notify_die(DIE_PAGE_FAULT). And btw DIE_PAGE_FAULT has no users. > > DIE_MNI too... > > > > Perhaps we can simply kill it on x86? > > So in theory we could still have it run from DIE_OOPS, and that could turn a > survivable kernel crash into a non-survivable one. I don't understand... But OK, my understanding of this magic is very limited, please forget. Thanks, Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org