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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 82557C433E0 for ; Thu, 18 Feb 2021 11:28:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C66AE64E76 for ; Thu, 18 Feb 2021 11:28:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C66AE64E76 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 367236B0006; Thu, 18 Feb 2021 06:28:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3179B6B006C; Thu, 18 Feb 2021 06:28:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 207E06B006E; Thu, 18 Feb 2021 06:28:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 039B36B0006 for ; Thu, 18 Feb 2021 06:28:38 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C2A3B52A3 for ; Thu, 18 Feb 2021 11:28:38 +0000 (UTC) X-FDA: 77831165916.16.blade46_3104f3727654 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id A361E100E690B for ; Thu, 18 Feb 2021 11:28:38 +0000 (UTC) X-HE-Tag: blade46_3104f3727654 X-Filterd-Recvd-Size: 3747 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 11:28:37 +0000 (UTC) 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: 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 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