From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx140.postini.com [74.125.245.140]) by kanga.kvack.org (Postfix) with SMTP id 00D3C6B0032 for ; Thu, 23 May 2013 17:49:29 -0400 (EDT) Date: Thu, 23 May 2013 14:49:28 -0700 From: Andrew Morton Subject: Re: [PATCH v8 3/9] vmcore: treat memory chunks referenced by PT_LOAD program header entries in page-size boundary in vmcore_list Message-Id: <20130523144928.0328bb3ad7ccc1ff2da9558d@linux-foundation.org> In-Reply-To: <20130523052513.13864.85440.stgit@localhost6.localdomain6> References: <20130523052421.13864.83978.stgit@localhost6.localdomain6> <20130523052513.13864.85440.stgit@localhost6.localdomain6> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: HATAYAMA Daisuke Cc: vgoyal@redhat.com, ebiederm@xmission.com, cpw@sgi.com, kumagai-atsushi@mxc.nes.nec.co.jp, lisa.mitchell@hp.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, zhangyanfei@cn.fujitsu.com, jingbai.ma@hp.com, linux-mm@kvack.org, riel@redhat.com, walken@google.com, hughd@google.com, kosaki.motohiro@jp.fujitsu.com On Thu, 23 May 2013 14:25:13 +0900 HATAYAMA Daisuke wrote: > Treat memory chunks referenced by PT_LOAD program header entries in > page-size boundary in vmcore_list. Formally, for each range [start, > end], we set up the corresponding vmcore object in vmcore_list to > [rounddown(start, PAGE_SIZE), roundup(end, PAGE_SIZE)]. > > This change affects layout of /proc/vmcore. Well, changing a userspace interface is generally unacceptable because it can break existing userspace code. If you think the risk is acceptable then please do explain why. In great detail! > The gaps generated by the > rearrangement are newly made visible to applications as > holes. Concretely, they are two ranges [rounddown(start, PAGE_SIZE), > start] and [end, roundup(end, PAGE_SIZE)]. > > Suppose variable m points at a vmcore object in vmcore_list, and > variable phdr points at the program header of PT_LOAD type the > variable m corresponds to. Then, pictorially: > > m->offset +---------------+ > | hole | > phdr->p_offset = +---------------+ > m->offset + (paddr - start) | |\ > | kernel memory | phdr->p_memsz > | |/ > +---------------+ > | hole | > m->offset + m->size +---------------+ > > where m->offset and m->offset + m->size are always page-size aligned. -- 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