Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7255850pxb; Thu, 18 Feb 2021 05:45:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzotEvpAUrLJ6eoc7iKni9grWqzibPrrErsUnzTUJ+odTRag+RyJtsDA++Lmb919Nn+sCr9 X-Received: by 2002:a17:906:2358:: with SMTP id m24mr4115323eja.333.1613655925811; Thu, 18 Feb 2021 05:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613655925; cv=none; d=google.com; s=arc-20160816; b=IU6unciZRU5F4o3kq3EQxGgc7Ajd6Rd7Isb/oe3FPVpw4F6QeVHAnt/L+tKmBtgilI N2/ieTHuqJlw07fd808aYuD7J/UXQKCHhnBAAPdHBN7iv+8rhm6UbxvIFIwEk9QijesT CFwBTv/V5QVGhlSyaA+vqHRJR5mNNSr1dDLwKQZTausp4Ia+An33uFr8Kt0JQ7RT1Gcd tdEf/vDoT51OpfDTALML14J7TOEHftMGjBofa3oK7fTyr2dHgT4zYezWZ4IcBMqAYKp6 c2fo+Wt7DsXSFufxCsMw63Ej6HWxLgkG00B2Xq12A28hn35duJ4K4IUrcIDj3RjbkiBp drqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GmsCgAZLPBXWqpRTBQJmNesuC+VzbGrswlfwNCxzi2Y=; b=fv6yqSESsd4fojN5OnEonFrtxPd2EgoU8a5Dy3m08rBrNNj0EFcdZ7BN8QpluUR3QJ 7bG3wFgc8QCZ54WECTyeTpQDGLqw0BvSr327MFmSe9IzlfEfrGBaAGCl5FL+MnTKeQDK UM7sl2zMejI0kdiFKbG0wW1ZWxCEUy0JRFEI74EAOcbWPkvdau/wMCeQPFH+zm/g7naK tsLeRfTuLVSE8lELG14iOi6USwps1s7vPHV0uvsdg0y6hkr2fj0Uvscr6Lr1+jRt4hKu wrnDUAX8UxU6km7PctgKN+lCmXwV59fP28eDTil6s2yok1y9VNCLiK80I9PFb251CtYk u8KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=DW7BCx40; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de55si3125449ejc.693.2021.02.18.05.45.01; Thu, 18 Feb 2021 05:45:25 -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=@suse.com header.s=susede1 header.b=DW7BCx40; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231452AbhBRNnV (ORCPT + 99 others); Thu, 18 Feb 2021 08:43:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:54006 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhBRLyd (ORCPT ); Thu, 18 Feb 2021 06:54:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1613647717; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GmsCgAZLPBXWqpRTBQJmNesuC+VzbGrswlfwNCxzi2Y=; b=DW7BCx40StPXtRqi8TB9MbTLE/gLCOfiRxXTism98TewhMtE8dWM10Pp3Z7pvRUoPLv1Z0 Jof5xr9quqaa8Gz7Y0grIaJYTF7eIK4n88jHV+9sm+FC9vP8Py2LxfZ+9JDhBS/rpaqj0x JpYoUbS82OvN/3IGwpm+jVaj8mq1aWM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B667AAFF8; Thu, 18 Feb 2021 11:28:35 +0000 (UTC) Date: Thu, 18 Feb 2021 12:28:34 +0100 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Arnd Bergmann , Oscar Salvador , Matthew Wilcox , Andrea Arcangeli , Minchan Kim , Jann Horn , Jason Gunthorpe , Dave Hansen , Hugh Dickins , Rik van Riel , "Michael S . Tsirkin" , "Kirill A . Shutemov" , Vlastimil Babka , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Chris Zankel , Max Filippov , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org Subject: Re: [PATCH RFC] mm/madvise: introduce MADV_POPULATE to prefault/prealloc memory Message-ID: References: <20210217154844.12392-1-david@redhat.com> <3763a505-02d6-5efe-a9f5-40381acfbdfd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 18-02-21 11:54:48, David Hildenbrand wrote: > > > > If we hit > > > > hardware errors on pages, ignore them - nothing we really can or > > > > should do. > > > > 3. On errors during MADV_POPULATED, some memory might have been > > > > populated. Callers have to clean up if they care. > > > > > > How does caller find out? madvise reports 0 on success so how do you > > > find out how much has been populated? > > > > If there is an error, something might have been populated. In my QEMU > > implementation, I simply discard the range again, good enough. I don't > > think we need to really indicate "error and populated" or "error and not > > populated". > > Clarifying again: if madvise(MADV_POPULATED) succeeds, it returns 0. If > there was a problem poopulating memory, it returns -ENOMEM (similar to > MADV_WILLNEED). Callers can detect the error and discard. As responded to the previous mail. I wouldn't really bother telling callers what they should do. The interface will not give them any means to identify the error. They just have to live with the fact that the operation has failed. -- Michal Hocko SUSE Labs