Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp691099yba; Wed, 15 May 2019 08:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQLDk0x42tipWWszedpNQC9z5yoieCQfbJv5uDey7ckNFkI1W2r4tUfgxspMtbxY0deRqk X-Received: by 2002:a63:785:: with SMTP id 127mr42322291pgh.230.1557933581078; Wed, 15 May 2019 08:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557933581; cv=none; d=google.com; s=arc-20160816; b=tMFklnD7QvHGtetDsHcn0rvgaOD430X5egKYjpS+t1tro09EWzjrVW/nxT7jVKTRud taNnmqnxGRUSUZHjzIaC1NJx7zAGaue/wcYOR4N/MAv4u2+REwh4LYED+zYFrwN5B1nF xzc/qhXkfnqQjyWcBdjmvFKZGDEPJT7LO92jv3mdDYavxRFI7MfYd8Jhg4Ba6Ww2lV6i V2A3g+bhx67InNaduPlrDFlZ/5bhliBBR/vOBRHwhj9yjvup7gohc6yrUXbbTnoMCm14 O5CEogyrUn3uuYUn4ENcLOIvKnRhQEwoLzqsMKaloUtQtSYI588oM64nrS3mGMswBP7a 0scw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nKlUy/hi0pOvOwp9+flkg2CxiT2GvqwO6wvGfA+BWbw=; b=Qraab6YDFW9U4ubqW6K+kyyO7sneWGv5xBcxukS/XRTFlDaOspMyKbY41HEb2ldAnG RwoNc5eV2atmvUaVnCBLVfzDs3Q2b8+N6003mk8CCHAKSSdRGNwJlu7aDC/FvaKEZRNX +iXIVHhPHHXSKRljaGfxadybfRzeoy84IcneGgXWaNb+OcGWG2e063PJMvFDW3m4kfam rgsbzGuBK6W2WK2g8HN/kZ0xq+eq1QiJBZNTu1OIRtA/T1ITIq3KtEbrTMjvVFSqukOv 3GGzfcyp9oGRKolNSGQBt5squ2uFF5KIsH5DJlIzACc3KQ/t9p72zJANAB7A87YNlO4T 2pqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tB4V3nQd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si794734plt.232.2019.05.15.08.19.25; Wed, 15 May 2019 08:19:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tB4V3nQd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727726AbfEOPSS (ORCPT + 99 others); Wed, 15 May 2019 11:18:18 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54306 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbfEOPSS (ORCPT ); Wed, 15 May 2019 11:18:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nKlUy/hi0pOvOwp9+flkg2CxiT2GvqwO6wvGfA+BWbw=; b=tB4V3nQd2C2I75CfF3dnpH/D8 afJxcTTl3v9s5M27ZpBjsj2FhoMDXtk+xX300GkyzknTnwHOMK7dFZjDUJLFVbJqFfsykTYTqkTDd xtBfoJcdtvTjztwwz/gvFno5ysKIRrGqF5indcfeedmRa6tF45nuDcZn/H1icaLOk2mcvpkjRrqQM fHFal71CVmW2uWOVt5CER3FpAXZWYR0dcbZadz0A2WREgGofJx6X0X6kbxK0FfjFbs2Znq+9CVJWT CqJc7Ye+8NeGL+5n6K1Z/Nnj3JmuO3SQ7Jl9TdkEiK4CnHtzUdnpVcgd9nhX1aoFGpAHDxb2MHZlM xG4tl8AuQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQvfb-0001fU-1F; Wed, 15 May 2019 15:18:15 +0000 Date: Wed, 15 May 2019 08:18:14 -0700 From: Matthew Wilcox To: Eric Dumazet Cc: Lech Perczak , Al Viro , "linux-kernel@vger.kernel.org" , Piotr Figiel , Krzysztof =?utf-8?Q?Drobi=C5=84ski?= , Pawel Lenkow , "linux-mm@kvack.org" , Greg Kroah-Hartman Subject: Re: Recurring warning in page_copy_sane (inside copy_page_to_iter) when running stress tests involving drop_caches Message-ID: <20190515151814.GD31704@bombadil.infradead.org> References: <14c9e6f4-3fb8-ca22-91cc-6970f1d52265@camlintechnologies.com> <011a16e4-6aff-104c-a19b-d2bd11caba99@camlintechnologies.com> <20190515144352.GC31704@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 15, 2019 at 08:02:17AM -0700, Eric Dumazet wrote: > On Wed, May 15, 2019 at 7:43 AM Matthew Wilcox wrote: > > You're seeing a race between page_address(page) being called twice. > > Between those two calls, something has caused the page to be removed from > > the page_address_map() list. Eric's patch avoids calling page_address(), > > so apply it and be happy. > > Hmm... wont the kmap_atomic() done later, after page_copy_sane() would > suffer from the race ? > > It seems there is a real bug somewhere to fix. No. page_address() called before the kmap_atomic() will look through the list of mappings and see if that page is mapped somewhere. We unmap lazily, so all it takes to trigger this race is that the page _has_ been mapped before, and its mapping gets torn down during this call. While the page is kmapped, its mapping cannot be torn down.