From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03E14C433DB for ; Tue, 5 Jan 2021 09:16:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C8F2229C7 for ; Tue, 5 Jan 2021 09:16:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7C8F2229C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 95BDE8D006F; Tue, 5 Jan 2021 04:16:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 90D528D006E; Tue, 5 Jan 2021 04:16:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84A328D006F; Tue, 5 Jan 2021 04:16:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 70F328D006E for ; Tue, 5 Jan 2021 04:16:40 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 34CB18248047 for ; Tue, 5 Jan 2021 09:16:40 +0000 (UTC) X-FDA: 77671166160.10.cable03_1d07d50274d7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 0E91916A07E for ; Tue, 5 Jan 2021 09:16:40 +0000 (UTC) X-HE-Tag: cable03_1d07d50274d7 X-Filterd-Recvd-Size: 4043 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 Jan 2021 09:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609838198; 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=3/mNj4FXntJ6f+kqOYOdyOb/PeZxp46sguDuCB5Sa8g=; b=gVAwIwT3y1cQ3XjFOnay0M81TKVpLO5CebapgXkgSYEtWf/BYPq/xVgbDAX/aGGjkh+Hnq yx4BGTDg8limHuB/q1ZZzmglvi/2lsVDPPZnjeDvdIb8sVjavW2Rh8otC1ukBG/HaNIWFa CnT1yKZ5HPqqGNp3sExywGsqhMQ1Ey4= 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-345-67LHksxIP_6SrGcjPnQ5tw-1; Tue, 05 Jan 2021 04:16:36 -0500 X-MC-Unique: 67LHksxIP_6SrGcjPnQ5tw-1 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 F2863800D62; Tue, 5 Jan 2021 09:16:34 +0000 (UTC) Received: from [10.36.114.117] (ovpn-114-117.ams2.redhat.com [10.36.114.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0FD060873; Tue, 5 Jan 2021 09:16:33 +0000 (UTC) Subject: Re: uninitialized pmem struct pages To: Michal Hocko , Dan Williams Cc: Linux MM , LKML References: <20210104100323.GC13207@dhcp22.suse.cz> <033e1cd6-9762-5de6-3e88-47d3038fda7f@redhat.com> <20210105075028.GS13207@dhcp22.suse.cz> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <5fa1ff35-71f3-2526-6819-34c1ee959295@redhat.com> Date: Tue, 5 Jan 2021 10:16:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210105075028.GS13207@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 05.01.21 08:50, Michal Hocko wrote: > On Mon 04-01-21 21:17:43, Dan Williams wrote: >> On Mon, Jan 4, 2021 at 2:45 AM David Hildenbrand wrote: > [...] >>> I believe Dan mentioned somewhere that he wants to see a real instance >>> of this producing a BUG before actually moving forward with a fix. I >>> might be wrong. >> >> I think I'm missing an argument for the user-visible effects of the >> "Bad." statements above. I think soft_offline_page() is a candidate >> for a local fix because mm/memory-failure.c already has a significant >> amount of page-type specific knowledge. So teaching it "yes" for >> MEMORY_DEVICE_PRIVATE-ZONE_DEVICE and "no" for other ZONE_DEVICE seems >> ok to me. > > I believe we do not want to teach _every_ pfn walker about zone device > pages. This would be quite error prone. Especially when a missig check > could lead to a silently broken data or BUG_ON with debugging enabled > (which is not the case for many production users). Or are we talking > about different bugs here? I'd like us to stick to the documentation, e.g., include/linux/mmzone.h " pfn_valid() is meant to be able to tell if a given PFN has valid memmap associated with it or not. This means that a struct page exists for this pfn. The caller cannot assume the page is fully initialized in general. Hotplugable pages might not have been onlined yet. pfn_to_online_page() will ensure the struct page is fully online and initialized. Special pages (e.g. ZONE_DEVICE) are never onlined and should be treated accordingly. " -- Thanks, David / dhildenb