Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4036992ybg; Mon, 21 Oct 2019 02:45:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjs1Chn2aqsxOAKFng/TmKKiPiF2tdclW4R6DVSm3IxEH3k6RlQvr00WKfQab+n5P9Dnyc X-Received: by 2002:a17:906:b781:: with SMTP id dt1mr20992395ejb.221.1571651141117; Mon, 21 Oct 2019 02:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571651141; cv=none; d=google.com; s=arc-20160816; b=AaqB4r/R4JT8PKg99u+edbRYFDCLU+rxdxu+yQT8fkgBXuAOzMslTwVoeJF1suQRB/ MVvB6N8NLT7DO8x5ebiEKafeBL8DJUFM/Y8AxpqkG4ePeaEHdMPXaynyY3XUMVgcW1Yo kHlR5/w2t1yZoF+JLlT9Xv14xnJ9zLrOAUOy5OREE8n16JT+zi+bJBe9lgWymnwBPy+S rO7poaMNhxlKoXmFkf2rQ7f5c+GXlP8mrtv11XWUS7k6Q6g5pqpmGT1Equc/yHe3Qqt1 IjFHOCVYygKq/wrql1SiGtQw2bkn2UuRBT9Q9rwzhefG01ktT3V3bncVtlTo2o/FokXm UPJw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=1Bv9eBgQEb7HJVfEzfT6QuC1WXe26mg6vGbFTeUwq3g=; b=BN9bodDtxeFme0lhsetWR5tiUPRAoJghlmMCUCsEOmyrgRd4ZeB/z3rfmUyrw946GP Nqm/x1xpS/UgCrgdy9W641FEJZu9TI4rye7cRw1bymMBZYRbOQi9me0fDzLobBBPuq6X BAU1LX+9zhvbzwOEHvjT9vc/EISqUovS05qZ/5HARvUzmHjUYZqaA77ykCl9yv2sfzib mYh6gyAkur3aEhkjhUgXHDJrULygAlVgHm0FItGGNTvDuYdxmwvVYqAs942xYvbGQb5t JqV60h8NZAScECCy48Dm2kusE/psOTk47rFOwoq2UhfE4Gx2So+pZEJh+ckLF5By7N+H cw4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CIjNdgp6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oe23si8105826ejb.199.2019.10.21.02.45.17; Mon, 21 Oct 2019 02:45: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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CIjNdgp6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbfJUJo1 (ORCPT + 99 others); Mon, 21 Oct 2019 05:44:27 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58300 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726987AbfJUJo1 (ORCPT ); Mon, 21 Oct 2019 05:44:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571651066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Bv9eBgQEb7HJVfEzfT6QuC1WXe26mg6vGbFTeUwq3g=; b=CIjNdgp6I7x//WnaDDSzZ78mPy7CjqHthMZqIwWuxU2cBZWrUUlj/YLyNSALwzgTxXbWjL ZNymcoCL/5smMh67BX3DrkoIvsTWUiSa+O5A0U+VWTwoPCnYoMJukvLXtQ3ZQVRLDhPYR0 l3ZPreppa5vEq/bjKoIqFXDlfTIhVpQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-349-t83UrnCzO4uzxfiGOtzskg-1; Mon, 21 Oct 2019 05:44:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 79385107AD31; Mon, 21 Oct 2019 09:44:21 +0000 (UTC) Received: from [10.36.116.198] (ovpn-116-198.ams2.redhat.com [10.36.116.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63E83608C0; Mon, 21 Oct 2019 09:44:20 +0000 (UTC) Subject: Re: [PATCH v2 2/2] mm/memory-failure.c: Don't access uninitialized memmaps in memory_failure() To: Andrew Morton Cc: Naoya Horiguchi , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Michal Hocko References: <20191009142435.3975-1-david@redhat.com> <20191009142435.3975-3-david@redhat.com> <20191010002619.GB3585@hori.linux.bs1.fc.nec.co.jp> <134d4f03-a40a-fe62-fb93-53d209a91d2e@redhat.com> <20191018190531.975b70fabdce5f7e5d6b27df@linux-foundation.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <15e0a869-4edf-a5c4-64b1-5ed25a6ff720@redhat.com> Date: Mon, 21 Oct 2019 11:44:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191018190531.975b70fabdce5f7e5d6b27df@linux-foundation.org> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: t83UrnCzO4uzxfiGOtzskg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed 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 19.10.19 04:05, Andrew Morton wrote: > On Thu, 10 Oct 2019 09:17:42 +0200 David Hildenbrand w= rote: >=20 >>>> -=09pgmap =3D get_dev_pagemap(pfn, NULL); >>>> -=09if (pgmap) >>>> -=09=09return memory_failure_dev_pagemap(pfn, flags, pgmap); >>>> - >>>> -=09p =3D pfn_to_page(pfn); >>> >>> This change seems to assume that memory_failure_dev_pagemap() is never >>> called for online pages. Is it an intended behavior? >>> Or the concept "online pages" is not applicable to zone device pages? >> >> Yes, that's the real culprit. ZONE_DEVICE/devmem pages are never online >> (SECTION_IS_ONLINE). The terminology "online" only applies to pages that >> were given to the buddy. And as we support sup-section hotadd for >> devmem, we cannot easily make use of the section flag it. I already >> proposed somewhere to convert SECTION_IS_ONLINE to a subsection bitmap >> and call it something like pfn_active(). >> >> pfn_online() would then be "pfn_active() && zone !=3D ZONE_DEVICE". And = we >> could use pfn_active() everywhere to test for initialized memmaps (well, >> besides some special cases like device reserved memory that does not >> span full sub-sections). Until now, nobody volunteered and I have other >> things to do. >=20 > Is it worth a code comment or two to make this clearer? You mean something like /* Only pages managed by the buddy are online (not ZONE_DEVICE). */ ? --=20 Thanks, David / dhildenb