Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbbFLWbf (ORCPT ); Fri, 12 Jun 2015 18:31:35 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:40774 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752019AbbFLWbd (ORCPT ); Fri, 12 Jun 2015 18:31:33 -0400 Message-ID: <557B5D7E.8080607@oracle.com> Date: Fri, 12 Jun 2015 18:30:22 -0400 From: Boris Ostrovsky User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Oleg Nesterov , Ingo Molnar CC: Linus Torvalds , Waiman Long , Thomas Gleixner , Denys Vlasenko , Borislav Petkov , Andrew Morton , Andy Lutomirski , linux-mml@vger.kernel.org, Linux Kernel Mailing List , Brian Gerst , "H. Peter Anvin" , Peter Zijlstra Subject: Re: [PATCH 07/12] x86/virt/guest/xen: Remove use of pgd_list from the Xen guest code References: <1434031637-9091-1-git-send-email-mingo@kernel.org> <1434031637-9091-8-git-send-email-mingo@kernel.org> <20150612072302.GA7509@gmail.com> <20150612080425.GC8759@gmail.com> <20150612203832.GA18966@redhat.com> <20150612205331.GB18966@redhat.com> In-Reply-To: <20150612205331.GB18966@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1317 Lines: 47 On 06/12/2015 04:53 PM, Oleg Nesterov wrote: > On 06/12, Oleg Nesterov wrote: >> >> On 06/12, Ingo Molnar wrote: >>> >>> * Linus Torvalds wrote: >>> >>>> So I think the only issue is that ->mm can become NULL when the thread group >>>> leader dies - a non-NULL mm should always be shared among all threads. >>> >>> Indeed, we do that in exit_mm(). >> >> Yes, >> >>> So we could add tsk->mm_leader or so, >> >> No, no, please do not. Just do something like >> >> for_each_process(p) { >> >> for_each_thread(p, t) { >> if (t->mm) { >> do_something(t->mm); >> break; >> } >> } >> } >> >> But either way I don't understand what protects this ->mm. Perhaps this needs >> find_lock_task_mm(). > > And, I don't understand this code, probably this doesn't matter, but. > > unpin_all() is probably fine, but xen_mm_pin_all() can race with fork() > and miss the new child. Is it OK? Currently xen_mm_pin_all() is only called in the suspend path, out of stop_machine(), so presumably at that time fork is not possible. -boris -- 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/