Received: by 10.223.176.46 with SMTP id f43csp826414wra; Fri, 19 Jan 2018 02:34:37 -0800 (PST) X-Google-Smtp-Source: ACJfBotqLzZV/Xp2bL+hqdT2x1U/b135BK1P7VYsB8kQZ1mAJCLOm1/aA/vSMV6hnKTJ5ePdtV+g X-Received: by 10.98.55.3 with SMTP id e3mr14922512pfa.119.1516358076843; Fri, 19 Jan 2018 02:34:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516358076; cv=none; d=google.com; s=arc-20160816; b=hh0ijJMO2cZJAGEkeDk+67ycO2Ts+lUU/cqrp1Cm0LGwLMSrPGiwEzgvi4qI84l4Pj mzRVJyv+tXqT2p/lh2EojFNtGPzbWESCFYi0vLwthIlHxv3swvfDB6baG4pMNF1L86V7 B6m0jg/6bQnq3b5Zmzm8UBqMnrEnVGJlYKsgYJu+XdqRo+GqBjpkbdyZi19puoNrxo6c gRNVPKPwM0GG2716Ehn0vKNIxktAelaie+Q0zN+zClNgU9KkU1rCgNjYpds5Gqt2fGpg rdj7ppJIyyNdiK5GHFqgvHOFqpm5r9dkoEStqDb26aA9Ej9tabA2L3Zg1cmatCwPo7NW vQGA== 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:arc-authentication-results; bh=zYfO2x0iIZ12xVZICWjPPXMdKeW4KV045e0vVvslFM8=; b=FDFpmjrBEheSPg/5QY4gxzZpL7YEAcitOItNj2RuOCLxiOV78CMdARTEqXbrDqAA4a aGxuaF+ihMAgSL0/L2eSYtT0DzFkGpXFIyNLEfz9V/wU0NEJmZJbjaqqxlra1xHybuRl 8NLsATlCRhQyxKy1m5z5+SNW4y2VozE3UyICMWoj9zHwCE7UC1attZixO9PO4QR1W7nh nWBxGnVQe1Gc8jy2k3/dqBVnEoZYULstwupRc0yt6ljtKoI6YRaLip8MpTbf2iOP4q63 Mddq7AaTj7yy8m9tC92IKykXOJNyX621SyJQQ9nuYlU62Yvv74BC2pRmbbHrE8GMyqD5 S4Mw== ARC-Authentication-Results: i=1; mx.google.com; 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 i128si2626299pgd.201.2018.01.19.02.34.22; Fri, 19 Jan 2018 02:34:36 -0800 (PST) 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; 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 S1754070AbeASKdv (ORCPT + 99 others); Fri, 19 Jan 2018 05:33:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:44823 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeASKds (ORCPT ); Fri, 19 Jan 2018 05:33:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BD0B3AD95; Fri, 19 Jan 2018 10:33:46 +0000 (UTC) Date: Fri, 19 Jan 2018 11:33:42 +0100 From: Michal Hocko To: "Kirill A. Shutemov" Cc: Dave Hansen , Tetsuo Handa , torvalds@linux-foundation.org, kirill.shutemov@linux.intel.com, akpm@linux-foundation.org, hannes@cmpxchg.org, iamjoonsoo.kim@lge.com, mgorman@techsingularity.net, tony.luck@intel.com, vbabka@suse.cz, aarcange@redhat.com, hillf.zj@alibaba-inc.com, hughd@google.com, oleg@redhat.com, peterz@infradead.org, riel@redhat.com, srikar@linux.vnet.ibm.com, vdavydov.dev@gmail.com, mingo@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Subject: Re: [mm 4.15-rc8] Random oopses under memory pressure. Message-ID: <20180119103342.GS6584@dhcp22.suse.cz> References: <201801170233.JDG21842.OFOJMQSHtOFFLV@I-love.SAKURA.ne.jp> <201801172008.CHH39543.FFtMHOOVSQJLFO@I-love.SAKURA.ne.jp> <201801181712.BFD13039.LtHOSVMFJQFOFO@I-love.SAKURA.ne.jp> <20180118122550.2lhsjx7hg5drcjo4@node.shutemov.name> <20180118154026.jzdgdhkcxiliaulp@node.shutemov.name> <20180118172213.GI6584@dhcp22.suse.cz> <20180119100259.rwq3evikkemtv7q5@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119100259.rwq3evikkemtv7q5@node.shutemov.name> 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 Fri 19-01-18 13:02:59, Kirill A. Shutemov wrote: > On Thu, Jan 18, 2018 at 06:22:13PM +0100, Michal Hocko wrote: > > On Thu 18-01-18 18:40:26, Kirill A. Shutemov wrote: > > [...] > > > + /* > > > + * Make sure that pages are in the same section before doing pointer > > > + * arithmetics. > > > + */ > > > + if (page_to_section(pvmw->page) != page_to_section(page)) > > > + return false; > > > > OK, THPs shouldn't cross memory sections AFAIK. My brain is meltdown > > these days so this might be a completely stupid question. But why don't > > you simply compare pfns? This would be just simpler, no? > > In original code, we already had pvmw->page around and I thought it would > be easier to get page for the pte intead of looking for pfn for both > sides. > > We these changes it's no longer the case. > > Do you care enough to send a patch? :) Well, memory sections are sparsemem concept IIRC. Unless I've missed something page_to_section is quarded by SECTION_IN_PAGE_FLAGS and that is conditional to CONFIG_SPARSEMEM. THP is a generic code so using it there is wrong unless I miss some subtle detail here. Comparing pfn should be generic enough. -- Michal Hocko SUSE Labs