Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbeAPSrM (ORCPT + 1 other); Tue, 16 Jan 2018 13:47:12 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:46182 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbeAPSrL (ORCPT ); Tue, 16 Jan 2018 13:47:11 -0500 Subject: Re: [PATCH 1/2] xen/grant-table: Use put_page instead of free_page To: Ross Lagerwall , xen-devel@lists.xenproject.org Cc: Juergen Gross , linux-kernel@vger.kernel.org References: <20180111093638.28937-1-ross.lagerwall@citrix.com> <20180111093638.28937-2-ross.lagerwall@citrix.com> From: Boris Ostrovsky Message-ID: <6d3faf73-c8aa-db9a-1629-a9de85a1b377@oracle.com> Date: Tue, 16 Jan 2018 13:47:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20180111093638.28937-2-ross.lagerwall@citrix.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8776 signatures=668653 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160260 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/11/2018 04:36 AM, Ross Lagerwall wrote: > The page given to gnttab_end_foreign_access() to free could be a > compound page so use put_page() instead of free_page() since it can > handle both compound and single pages correctly. > > This bug was discovered when migrating a Xen VM with several VIFs and > CONFIG_DEBUG_VM enabled. It hits a BUG usually after fewer than 10 > iterations. All netfront devices disconnect from the backend during a > suspend/resume and this will call gnttab_end_foreign_access() if a > netfront queue has an outstanding skb. The mismatch between calling > get_page() and free_page() on a compound page causes a reference > counting error which is detected when DEBUG_VM is enabled. > > Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky