From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [patch v3 2/8] kdump: Make kimage_load_crash_segment() weak From: Michael Holzheu Reply-To: holzheu@linux.vnet.ibm.com In-Reply-To: <20110818171541.GC15413@redhat.com> References: <20110812134849.748973593@linux.vnet.ibm.com> <20110812134907.166585439@linux.vnet.ibm.com> <20110818171541.GC15413@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 19 Aug 2011 15:27:52 +0200 Message-ID: <1313760472.3858.26.camel@br98xy6r> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Vivek Goyal Cc: ebiederm@xmission.com, mahesh@linux.vnet.ibm.com, hbabu@us.ibm.com, oomichi@mxs.nes.nec.co.jp, horms@verge.net.au, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org List-ID: Hello Vivek, On Thu, 2011-08-18 at 13:15 -0400, Vivek Goyal wrote: > On Fri, Aug 12, 2011 at 03:48:51PM +0200, Michael Holzheu wrote: > > From: Michael Holzheu > > > > On s390 we do not create page tables at all for the crashkernel memory. > > This requires a s390 specific version for kimage_load_crash_segment(). > > Therefore this patch declares this function as "__weak". The s390 version is > > very simple. It just copies the kexec segment to real memory without using > > page tables: > > > > int kimage_load_crash_segment(struct kimage *image, > > struct kexec_segment *segment) > > { > > return copy_from_user_real((void *) segment->mem, segment->buf, > > segment->bufsz); > > } > > > > There are two main advantages of not creating page tables for the > > crashkernel memory: > > > > a) It saves memory. We have scenarios in mind, where crashkernel > > memory can be very large and saving page table space is important. > > b) We protect the crashkernel memory from being overwritten. > > Michael, > > Thinking more about it. Can't we provide a arch specific version of > kmap() and kunmap() so that we create temporary mappings to copy > the pages and then these are torn off. Isn't kmap/kunmap() used for higmem? These functions are called from many different functions in the Linux kernel, not only for kdump. I would assume that creating and removing mappings with these functions is not what a caller would expect and probably would break the Linux kernel at many other places, no? Perhaps we can finish this discussion after my vacation. I will change my patch series that we even do not need this patch... So only two common code patches are remaining. I will send the common code patches again and will ask Andrew Morton to integrate them in the next merge window. The s390 patches will be integrated by Martin. Michael