Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14439849pxu; Tue, 5 Jan 2021 01:20:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzutrHij2tfqTi3yZmAQmgu6v7nnVYwQ11ovmvI02MRyACaHlPeKW5d2GPW+kfDDvnxJLUp X-Received: by 2002:a17:906:ceca:: with SMTP id si10mr68594119ejb.547.1609838448176; Tue, 05 Jan 2021 01:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609838448; cv=none; d=google.com; s=arc-20160816; b=K8jujEfseZBPHOuEYwl1ILYCFXv2ykFoxwxH+EvTN4lvY5of3wFTfSKzBWaRVTal/z hDN9GIZJ59zcr2GbyKmwM1MrhoIfZpZLdKumBBrqFOy06aeJFBw+N8jbpXRAQojyqtLI /QrtfQvATJ2mmaunOggMZcwD2mzmh5uSCd34Kdf4OuazvghaSBqq7s3kejkHex+We5ie ytKjWP7EHO/WxTM7F7+LvfQ7BezhJ5k/MIrmNe+x3jgOHkFvENgP4AZOipsvqTXjBNFf m/XDcOatSPnLCj6fM/JobQJzLZcES00cJ5pQoOypeegVaNPZtjhfvWBT44ihI1jMGVzK VMFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=3/mNj4FXntJ6f+kqOYOdyOb/PeZxp46sguDuCB5Sa8g=; b=gPAi7b8QfjhEVOstGMaSW+AIIw4QfLZJocS/AIXy22n2m4ou26d7s4N4bAv5zrIB9l cgWYnFmq5NKl0GIrucWk3+aaCDoJ3SYJ1yBQ9IZ8F+XwlYF8NhuEeGiEDFD3PpU1hhv0 T47XE+QMj8CaCWq+vby7G/t28n6vhWT88+1ldn479CYkZiD6WjoK0aJhgidGWPJLZ16j DJfeIp7VvbfcJddRqMqfpfpVaCBvsmPu+SR6QDSNURQqi6Oo5RroQbc3vBWvJrBwMcDU WOAvmg6T5zriHoyAWCaBPzz21bm8lwsMdO9n2PKwnD/YrlOYGE9aDtG32Y82MtYrGmcI uBpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gVAwIwT3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id t4si33844596edq.607.2021.01.05.01.20.25; Tue, 05 Jan 2021 01:20:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gVAwIwT3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726231AbhAEJSE (ORCPT + 99 others); Tue, 5 Jan 2021 04:18:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22412 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725880AbhAEJSE (ORCPT ); Tue, 5 Jan 2021 04:18:04 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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