Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 6 Nov 2002 11:09:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 6 Nov 2002 11:09:20 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:54083 "EHLO frodo.biederman.org") by vger.kernel.org with ESMTP id ; Wed, 6 Nov 2002 11:09:18 -0500 To: Linus Torvalds Cc: Alan Cox , Werner Almesberger , Suparna Bhattacharya , Jeff Garzik , "Matt D. Robinson" , Rusty Russell , Linux Kernel Mailing List , , Subject: Re: [lkcd-devel] Re: What's left over. References: From: ebiederm@xmission.com (Eric W. Biederman) Date: 06 Nov 2002 09:13:18 -0700 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1635 Lines: 30 Linus Torvalds writes: > >From a sanity standpoint, I think the thing already _has_ a system call, > though: clearly "sys_reboot()" is the place to add a case for "reboot into > this image". No? That's where we shut down devices anyway, and it's the > sane place to say "reboot into the kexec image" When kexec is separated into two pieces I agree. As I had it initially in one step it does not look at all like reboot. Now I just need to think up a new magic number for sys_reboot. [snip wonderful vision of the theoretical simplicity of sys_kexec]. In case I was not sufficiently clear last night. It could be as simple as your example code if I replaced vmalloc by __get_free_pages/alloc_pages, and allocated a large contiguous area of ram. But MAX_ORDER limits me to 8MB images, and allocating an 8MB chunk is unreliable, and even a 2MB chunk is dangerous. So I must use some form of scatter/gather list of pages, like area ->pages[] to make it work. Things get tricky because I gather (via memcpy) the pages at a location that potentially overlaps the source pages. So I must walk through the list of pages making certain I when I gather (memcpy) the buffer pages into their final location I will not stomp on a buffer page I have not come to yet. Correctly doing that untangling is where the complexity in kernel/kexec.c comes from. Eric - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/