Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp673432yba; Wed, 15 May 2019 08:04:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzE+pML9S69D84Iiz643SQVK4PF3y19T4JWQ64pZLeQI6/w0jNizjdAPaYWVGwfsrQNasd X-Received: by 2002:a62:2ec4:: with SMTP id u187mr47490580pfu.84.1557932662576; Wed, 15 May 2019 08:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557932662; cv=none; d=google.com; s=arc-20160816; b=kG5bCOc4gTR+zqI0zGF1a3MzlNIvT7Y8aoXBxWRLw9v5R5W+NAQYJqQLFCksVUbcp+ 23+fXQW+AvUAO4XWjpGZjajDsXZPgOCRuVW+ByLDfjJ2n+Jbd7W7EnUBR0I1BsikonMb A36wJE7EpnXuIb0/NXAPPO+iYKJk6LG2g/sGBQiRIMi6gqpIcKKTPLcEvatVhjMfZmbR e5RoybfDQe6Lwwv5Z6zpIo0wvPlPVM8ShIjCEEk5kjvttoDXBjBfqcgRFK+mRrho92Uo qclYp/bd+vdukNv1Udn0a1++oQhPLNuDUyO++sumRMINfLkbTqHCFfmRRarolSuj/vuQ 9Qaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=JOLdwTp5zRnKj+hnZ/GDoFywULiYCABqyveX8EJm5BY=; b=YCG5nEXae6i66wFpFlws+qzPAVL/S0etnXMoj20uMGT51hxwj6NzdDuf687Dc5fHQL E85HeW/IafLF9yzUvNbD6sygJYIXOj/ZVdQfBOG2O5BjBeB+pqgUVSiYtDYtr3nn/Y1J qfLK+9kNramk5jzowdSXrVQEVoZK3+RfP1efcqS3eXqI+PNr01t6boXAHQ/VdJ3vZvF2 iXPf9wvO3KqjHgwHQ8SMtHCRU1rZ0vaYDpZcj2ZRZqEhr3z4D+EadrMl63J2t47Dy4Hr efEcOZoVvvlamx1rKLMRLssT/YXciPF6B1LMlwiCMD85zplZdLAQcvHBJl7l2WCNekC6 b52A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=K8tajLnU; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a71si1957277pge.211.2019.05.15.08.04.03; Wed, 15 May 2019 08:04:22 -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=pass header.i=@google.com header.s=20161025 header.b=K8tajLnU; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbfEOPCe (ORCPT + 99 others); Wed, 15 May 2019 11:02:34 -0400 Received: from mail-yw1-f41.google.com ([209.85.161.41]:45975 "EHLO mail-yw1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfEOPCc (ORCPT ); Wed, 15 May 2019 11:02:32 -0400 Received: by mail-yw1-f41.google.com with SMTP id w18so35210ywa.12 for ; Wed, 15 May 2019 08:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=JOLdwTp5zRnKj+hnZ/GDoFywULiYCABqyveX8EJm5BY=; b=K8tajLnUevxTs9F5zqowM410qkZAK9RFWtlu34lJ/mIkKmEnPdLHEDzVZZyuvMO4Cl ZT7hha/aWIN1JOqcnWJtq9c5byixcK6V73iTabiaIrYYXU1NuX9vAmE8/jcTJlcR7Yox t6YMB70z2IBohCh621ydwKso4naAlxgtPFpmsZeSq8dyMQ1YjH4lim4h1TVnGqWSYxwn Z7xuOkWOCe5xh/XxJegCGbY+qx7DeGwJ9Ut2heb16Q1CLBF3bFQo2WF95e8yNFm+uhug OkxNjXwqnXWCw7t8wdlkk/20/kul3QspQZpFzaQ3JCKeU3hpRUdc2qnWrMbSmbT4SlNT YTBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=JOLdwTp5zRnKj+hnZ/GDoFywULiYCABqyveX8EJm5BY=; b=d77i/CijFx7ba5ZP/BIorVJDZypAv0KEc0eut//daiMPLMvpjtSq5KkkZuWMWjAoqV doyPHzBihrsP3IVsVkMVnuzWcD/d70DCYSe9b9Ua1fSgThCMpZxPaARTzrwzy/qgLYfu 6aZcT/hpw8U6W+HNe//nIK5yCBMgwxYMXdiz7LsMwpp2ef0jKhzN4JmWJRvTxYgl9DBK NVEaUhFFPCkAykDMcDgU3AMngKaDbULRT34zH2RinCNwjV6I87HJvHbWjfanfenON3e8 OZRnU/JkJuqueSBZkvQVX871I6tvm7jZjRVVes51cs076Hnnyze6aplzNte55Sq5daSn DWVA== X-Gm-Message-State: APjAAAUjY9wa8bpkKfHAsJNgjAe/7wTrPZgz2DD4ktEAIv5YAk4CFgNU jK4N3oItKi9Fhzc81bNUsG0ZCYiEclyd1te8Eto/0FouFyalLw== X-Received: by 2002:a81:27cc:: with SMTP id n195mr21182715ywn.60.1557932550591; Wed, 15 May 2019 08:02:30 -0700 (PDT) MIME-Version: 1.0 References: <14c9e6f4-3fb8-ca22-91cc-6970f1d52265@camlintechnologies.com> <011a16e4-6aff-104c-a19b-d2bd11caba99@camlintechnologies.com> <20190515144352.GC31704@bombadil.infradead.org> In-Reply-To: <20190515144352.GC31704@bombadil.infradead.org> From: Eric Dumazet Date: Wed, 15 May 2019 08:02:17 -0700 Message-ID: Subject: Re: Recurring warning in page_copy_sane (inside copy_page_to_iter) when running stress tests involving drop_caches To: Matthew Wilcox Cc: Lech Perczak , Al Viro , "linux-kernel@vger.kernel.org" , Piotr Figiel , =?UTF-8?Q?Krzysztof_Drobi=C5=84ski?= , Pawel Lenkow , "linux-mm@kvack.org" , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 7:43 AM Matthew Wilcox wrote: > > > > W dniu 25.04.2019 o 11:25, Lech Perczak pisze: > > >> Some time ago, after upgrading the Kernel on our i.MX6Q-based boards= to mainline 4.18, and now to LTS 4.19 line, during stress tests we started= noticing strange warnings coming from 'read' syscall, when page_copy_sane(= ) check failed. Typical reproducibility is up to ~4 events per 24h. Warning= s origin from different processes, mostly involved with the stress tests, b= ut not necessarily with block devices we're stressing. If the warning appea= red in process relating to block device stress test, it would be accompanie= d by corrupted data, as the read operation gets aborted. > > >> > > >> When I started debugging the issue, I noticed that in all cases we'r= e dealing with highmem zero-order pages. In this case, page_head(page) =3D= =3D page, so page_address(page) should be equal to page_address(head). > > >> However, it isn't the case, as page_address(head) in each case retur= ns zero, causing the value of "v" to explode, and the check to fail. > > 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. > > Greg, can you consider 6daef95b8c914866a46247232a048447fff97279 for > backporting to stable? Nobody realised it was a bugfix at the time it > went in. I suspect there aren't too many of us running HIGHMEM kernels > any more. >