From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 6/7] proc: Introduce the /proc//dump file Date: Sat, 23 Jul 2011 12:49:22 +0400 Message-ID: <4E2A8B12.4010709@parallels.com> References: <4E204466.8010204@parallels.com> <4E204500.6040800@parallels.com> <20110721064408.GR3455@htj.dyndns.org> <4E2A8239.5060908@parallels.com> <20110723083711.GF21089@mtj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110723083711.GF21089-9pTldWuhBndy/B6EtB590w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: Glauber Costa , Cyrill Gorcunov , Nathan Lynch , Linux Containers , Serge Hallyn , Daniel Lezcano List-Id: containers.vger.kernel.org On 07/23/2011 12:37 PM, Tejun Heo wrote: > Hello, > > On Sat, Jul 23, 2011 at 12:11:37PM +0400, Pavel Emelyanov wrote: >> On 07/21/2011 10:44 AM, Tejun Heo wrote: >>> Most of information dumped here is already available >>> through /proc and ptrace and we can add the missing pieces like the >>> suggested proc vma fds. >> >> Let's start with the simplest things. Can you suggest the best (from you pov) >> way for dumping all the registers, tls and the anonymous pages through the >> existing interfaces? > > Just use ptrace. Seizing all threads in a process, gather file and > memory map info from /proc, inject a parasite to dump memory pages and > do whatever else. There's nothing special about TLS, fs/gs base is > already included in ptrace register dump in x86_64. Dunno how it's > handled in 32bit but if it's not available exporting it isn't a big > deal. Rebuilding the process image from the captured information > shouldn't be too hard. You're talking about your recent set for ptrace? Can you propose a quick scratch of how you propose to dump and restore registers and memory with this? > There is simply is no need to put CR into kernel at all. I don't want to! I propose to use small set of APIs for it and the execve handler is just the way to replace VM+regs of a task with another set. > Just add the > missing pieces to export the necessary information and missing APIs > which are required to restore it (e.g. setting TID like you did in > this patchset). Approaching it that way would make things useful for > other use cases && is highly more likely to get merged. There doesn't > even need to be one big merge day. You can just improve things > piecewise until it works. Totally agree. > Thanks. >