Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp472509pxy; Wed, 5 May 2021 06:44:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxahAx8VSAOhSVkEcNabaJzIJT6BNuQaZDH9m5Rs9zNcUKs1rZpI7/QZ+POFwsqvDaJOMEb X-Received: by 2002:a17:90a:c716:: with SMTP id o22mr3263151pjt.77.1620222276981; Wed, 05 May 2021 06:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620222276; cv=none; d=google.com; s=arc-20160816; b=T1MVBvIDT6utxVlQsbk7cTfKATm5nGBjtmeHAmHB0Fv5QIHWwRgIvFsOlU5sg5WQ9W Hpk49I9+gjGJunPkIVTtodlDHztPCarX5/CrbmLmsdn6Mlf2Oae8bEnWkq54x56KIS5z RCRZxxD2a6G83K3m4z16suEF/7nUaBg6JTATt+/EMyufBPKUF8Oj393283ARCE0OL93/ +XfS7ZQMarAUVpzl6Ag0Ux/Dx/tA/nJyD+r+YdcwwzhN23hAv2MTnkDJCR0DyeqKRzJy EVGbUW8CMX21HzhuV2ELfSPdxlMfK3EhwPzwcJIaWmrTAE5pO9Lbu5I8tnG5L6NNQj0d CAwQ== 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:subject :organization:from:references:cc:to:dkim-signature; bh=IHQUE4RBuZmI4g/5aOXOPIjM70ZyTC143fCzVAJ8P/8=; b=TQcjQIgZmstQEvZnTnMZZxwH/RKvv2zfDAWJOB4kuhK2U582tbu/9Nrgkyv70K4gQh MjVQO25MNePNxDUQFIj5tAo9piM3LH5TlO+rrqDOKSGVM3Xci7FzLEwCIyhrXH78lP9J fBK4zPh27d/lc/HajfkUaJlFEnOHK416XEdTm9loCHDPzTFZu5WM994jo45En/Xdijh/ sIe4kPtlnbp3++UPPJ/CDw9VKmQwrz5dcibsL86qZa0ErtRS05Zy1TLc32u5rd8F+yBX K1xo5Og17Z/wtjNd/NFLn1okbjxZcu+tgPymLckVAR7LzmLePuZKytCNL4gIoS8Pm/iB hYZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IzfXabDh; 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 bx23si7512047pjb.6.2021.05.05.06.44.23; Wed, 05 May 2021 06:44:36 -0700 (PDT) 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=IzfXabDh; 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 S233523AbhEENkK (ORCPT + 99 others); Wed, 5 May 2021 09:40:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56151 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230159AbhEENkJ (ORCPT ); Wed, 5 May 2021 09:40:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620221953; 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=IHQUE4RBuZmI4g/5aOXOPIjM70ZyTC143fCzVAJ8P/8=; b=IzfXabDhlFkN2KkOKsWJJIc0gsQUiIVy/r7T9flLxuwbgYWfjdzoPQnQd9J8BgvhA7UV9R FluEaCPMO8eUJRAjK/rcsswg2o1Tsd08GsfcIgbHn9VakY9HV6BJ/+6UEKwuf4vfqdos77 3ObNcxeicmYDQxtkIgXIz0axfDyypSs= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-158-C_AmhzB2Pm6xOjdfn3YTwA-1; Wed, 05 May 2021 09:39:11 -0400 X-MC-Unique: C_AmhzB2Pm6xOjdfn3YTwA-1 Received: by mail-ed1-f72.google.com with SMTP id y19-20020a0564022713b029038a9f36060dso873620edd.4 for ; Wed, 05 May 2021 06:39:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=IHQUE4RBuZmI4g/5aOXOPIjM70ZyTC143fCzVAJ8P/8=; b=ZveTn038FJnnPjYXe0FxnzJMZkRW12/6FZe+6Yh1zl5/QRW8gxaKAZ6zjecD8zs/jV n1vOYzLYx03lDxk/X9EhRZ+ioPcDzmWmzZnSikYfQscMPxcqxxCuYuPVFVJnwt/rLX16 Mya9Wr8Yy0+XcWcvVCSbIW+h/nTvCdxdVmhRE1XYW8qpcORGLO5FGIdKtV7vx4G79nSP 6YTKSlsE6XtN5UtMYmOHtodJFJulsm5q7aPFNc3Wc6mu4MjQt90LFMo8zs7pOnlUOHvg vINxUrM47zprb70Ij4i9MIRCHOgcapKjSlVRW8aj9yrtNNmrT4w1LE0jBROuv4FuVo3p Vzkw== X-Gm-Message-State: AOAM531+H4XLg2/yJVJpTLbPJ8hdy2fafnDJj1yaeAyGpca2Pg/OXizJ dDFIx/R61we2i8zROH9gGZNEe7H96EZsr7FS0x0smHNjF8Fy1Jovi9mdY89rwlJCNNYGYBcvHfX HN8hGNdqkJZBo9rvo2isG87we X-Received: by 2002:a17:906:2406:: with SMTP id z6mr3443999eja.396.1620221950190; Wed, 05 May 2021 06:39:10 -0700 (PDT) X-Received: by 2002:a17:906:2406:: with SMTP id z6mr3443980eja.396.1620221950000; Wed, 05 May 2021 06:39:10 -0700 (PDT) Received: from [192.168.3.132] (p5b0c63bc.dip0.t-ipconnect.de. [91.12.99.188]) by smtp.gmail.com with ESMTPSA id p21sm16699366edw.18.2021.05.05.06.39.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 06:39:09 -0700 (PDT) To: Michal Hocko , Andrew Morton Cc: linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Alexey Dobriyan , Mike Rapoport , "Matthew Wilcox (Oracle)" , Oscar Salvador , Roman Gushchin , Alex Shi , Steven Price , Mike Kravetz , Aili Yao , Jiri Bohac , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Naoya Horiguchi , linux-hyperv@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20210429122519.15183-1-david@redhat.com> <20210429122519.15183-4-david@redhat.com> <0710d8d5-2608-aeed-10c7-50a272604d97@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1 3/7] mm: rename and move page_is_poisoned() Message-ID: <57ac524c-b49a-99ec-c1e4-ef5027bfb61b@redhat.com> Date: Wed, 5 May 2021 15:39:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> Long story short, this should be good enough for the cases we actually can >> handle? What am I missing? > > I am not sure I follow. My point is that I fail to see any added value > of the check as it doesn't prevent the race (it fundamentally cannot as > the page can be poisoned at any time) but the failure path doesn't > put_page which is incorrect even for hwpoison pages. Oh, I think you are right. If we have a page and return NULL we would leak a reference. Actually, we discussed in that thread handling this entirely differently, which resulted in a v7 [1]; however Andrew moved forward with this (outdated?) patch, maybe that was just a mistake? Yes, I agree we should revert that patch for now. Regarding the race comment: AFAIU e.g., [2], it's not really a problem with a race, but rather some corner case issue that can happen if we fail in memory_failure(). [1] https://lkml.kernel.org/r/20210406104123.451ee3c3@alex-virtual-machine [2] https://lkml.kernel.org/r/20210331015258.GB22060@hori.linux.bs1.fc.nec.co.jp -- Thanks, David / dhildenb