From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757511AbcAJVkY (ORCPT ); Sun, 10 Jan 2016 16:40:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52355 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757293AbcAJVkW (ORCPT ); Sun, 10 Jan 2016 16:40:22 -0500 Date: Sun, 10 Jan 2016 23:40:17 +0200 From: "Michael S. Tsirkin" To: Minchan Kim Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Konstantin Khlebnikov , Rafael Aquini , stable@vger.kernel.org Subject: Re: [PATCH 2/2] virtio_balloon: fix race between migration and ballooning Message-ID: <20160110233310-mutt-send-email-mst@redhat.com> References: <1451259313-26353-1-git-send-email-minchan@kernel.org> <1451259313-26353-2-git-send-email-minchan@kernel.org> <20160101102756-mutt-send-email-mst@redhat.com> <20160104002747.GA31090@blaptop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160104002747.GA31090@blaptop.local> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2016 at 09:27:47AM +0900, Minchan Kim wrote: > > I think this will cause deadlocks. > > > > pages_lock now nests within page lock, balloon_page_putback > > nests them in the reverse order. > > In balloon_page_dequeu, we used trylock so I don't think it's > deadlock. I went over this again and I don't see the issue anymore. I think I was mistaken, so I dropped my patch and picked up yours. Sorry about the noise. > > > > Also, there's another issue there I think: after isolation page could > > also get freed before we try to lock it. > > If a page was isolated, the page shouldn't stay b_dev_info->pages > list so balloon_page_dequeue cannot see the page. > Am I missing something? I mean without locks, as it is now. With either your or my patch in place, it's fine. -- MST