From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760076AbdDSFc2 (ORCPT ); Wed, 19 Apr 2017 01:32:28 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34884 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759596AbdDSFcX (ORCPT ); Wed, 19 Apr 2017 01:32:23 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v2] mm: add VM_STATIC flag to vmalloc and prevent from removing the areas From: Hoeun Ryu X-Mailer: iPhone Mail (14E304) In-Reply-To: <20170418065946.GB22360@dhcp22.suse.cz> Date: Wed, 19 Apr 2017 14:32:14 +0900 Cc: hch@infradead.org, khandual@linux.vnet.ibm.com, Andrew Morton , Roman Pen , Andreas Dilger , Andrey Ryabinin , Chris Wilson , Ingo Molnar , zijun_hu , Matthew Wilcox , Thomas Garnier , "Kirill A. Shutemov" , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Message-Id: References: <1492494570-21068-1-git-send-email-hoeun.ryu@gmail.com> <20170418065946.GB22360@dhcp22.suse.cz> To: Michal Hocko Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3J5WrOx023612 > On Apr 18, 2017, at 3:59 PM, Michal Hocko wrote: > >> On Tue 18-04-17 14:48:39, Hoeun Ryu wrote: >> vm_area_add_early/vm_area_register_early() are used to reserve vmalloc area >> during boot process and those virtually mapped areas are never unmapped. >> So `OR` VM_STATIC flag to the areas in vmalloc_init() when importing >> existing vmlist entries and prevent those areas from being removed from the >> rbtree by accident. > > Has this been a problem in the past or currently so that it is worth > handling? > >> This flags can be also used by other vmalloc APIs to >> specify that the area will never go away. > > Do we have a user for that? > >> This makes remove_vm_area() more robust against other kind of errors (eg. >> programming errors). > > Well, yes it will help to prevent from vfree(early_mem) but we have 4 > users of vm_area_register_early so I am really wondering whether this is > worth additional code. It would really help to understand your > motivation for the patch if we were explicit about the problem you are > trying to solve. I just think that it would be good to make it robust against various kind of errors. You might think that's not an enough reason to do so though. > > Thanks > > -- > Michal Hocko > SUSE Labs