Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1138509iob; Thu, 12 May 2022 12:02:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWgTcyWucLvXHioT/OpOSGeCBkGujvpGiQDL/uJB2d8m3T5gYypH0J3aIJvAjyuI6WFr36 X-Received: by 2002:a54:4688:0:b0:324:ef47:98b7 with SMTP id k8-20020a544688000000b00324ef4798b7mr687652oic.29.1652382144453; Thu, 12 May 2022 12:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652382144; cv=none; d=google.com; s=arc-20160816; b=CqL/i1VxypbNnnWPI0/FgPprRSgmssH3iA2+toJ9sNvrf8su6px/XhVtVzaSGnCs+/ R6NOuy0YyeDLaDvMReM1HeRzuobcF+AkVwecgXZaU5C9lQVlXJBmbEsRgxsJ9sMl4Hht pUY3Dj/7qkEBPdQc4S3K4EbaWxctugr3ehjkovEYRObtgIAAN/qfyKvanPOCQXnAoMow jUVzmK3xT1eJcHaphO82ELt0EplnShIEMCu4fo2Q7dLTbZz9J5kXrTkbulKjH8w+56Rc vqRYsMgtbpBBLLsXQHra+tnn53oav0ba79G6EfIBaJguYrxSMH9SqnE3TvQy2QXSkfcO CcYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :ironport-hdrordr:ironport-data; bh=VGOoKD2kM7LB0Iy01gvlysuzbprQvkfjbjDA3iAOWzE=; b=gntKAJ/L/nCdEiWbvCdUfcF7+Hij73ANUaWzuOEf14tI/H7Rhe5QSlkaU29fh7zR8+ Th7ZghojIOJWslxZgkQJEKFV9BrKkHa4xA7vw0dhtqAd8tGoHILCvgwxasQvwGdxccDG tepMfKO5r83hgQxIusjqDaxS/BsPL+lBH6n9qmLlE9DJ8AgskX/gUAtzc8spTSr+nuYA I9ftzDdzLlOhKrkyPtPBSd3Hyq44r6T90K/ZGvQVFNEsrNWy6jgRp+ZTJ4oYzhmM4IFS aZcTcsN4uI3ORQgd9/Bpcx7tfTmHeqpyEJXjla//rAYWhXws9gz/X+Br1SDco6jza6qi +K/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc42-20020a05682016aa00b003244bc5df23si552407oob.31.2022.05.12.12.02.10; Thu, 12 May 2022 12:02:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353522AbiELM1V (ORCPT + 99 others); Thu, 12 May 2022 08:27:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiELM1T (ORCPT ); Thu, 12 May 2022 08:27:19 -0400 Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C69C13F5C; Thu, 12 May 2022 05:27:17 -0700 (PDT) IronPort-Data: =?us-ascii?q?A9a23=3A2J3H0ahOgBolD7Tcll9Sgf2TX161nREKZh0ujC4?= =?us-ascii?q?5NGQNrF6WrkUBzjEZXTvTPPbeMWWmc91/bYm//UNVsZHWzdBiQQpv/nw8FHgiR?= =?us-ascii?q?ejtX4rAdhiqV8+xwmwvdGo+toNGLICowPkcFhcwnT/wdOixxZVA/fvQHOCkUra?= =?us-ascii?q?dYnkZqTJME0/NtzoywobVvaY42bBVMyvV0T/Di5W31G2NglaYAUpIg063ky6Di?= =?us-ascii?q?dyp0N8uUvPSUtgQ1LPWvyF94JvyvshdJVOgKmVfNrbSq+ouUNiEEm3lExcFUrt?= =?us-ascii?q?Jk57wdAsEX7zTIROTzHFRXsBOgDAb/mprjPl9b6FaNC+7iB3Q9zx14M9QvJqrW?= =?us-ascii?q?EEnOLbQsOoAURhECDw4NqpDkFPCCSHl7ZXDnhaYKRMAxN0rVinaJ7Yw9u9pAG1?= =?us-ascii?q?m++YfLTcXZBGfwemxxdqTTuhqg8UqK8nmFIMCs25tzHfSCvNOaZDIQ43L49FC1?= =?us-ascii?q?Ts9j8wIGuzRD+IGaD5rfTzBZRNVM1saAZ54m/2n7lHzejseqhSKpK4z4mHW1yR?= =?us-ascii?q?w1qTgNJzefdnibclXgUGeqUrF8n7/DxVcM8aQoRKB83SxlqrKmAv4RosZF/u/7?= =?us-ascii?q?PECqFSQ3mk7DBwQSEv+r/6kjEK3R9NYLQoT4CVGha4s+E2uS/H5XgakuziAvxg?= =?us-ascii?q?BS5xcHvNSwAeEzbvdpQaeHGkLUzVBafQgucRwTjsvvneLltXkQzdvrZWSU3uW8?= =?us-ascii?q?rrSpjS3UQAPImgGaTAVSyMe/sLu5o0+5jrLT9B+AOu7ldH4Bzz06y6FoTJ4hLg?= =?us-ascii?q?Ji8MPkaKh8jjvhzOqu4iMTQMv4AjTdnyq4xk/Z4O/YYGsr1/B4p5oKIefU0nEr?= =?us-ascii?q?HYfs9aR4fpIDpyXkiGJBuIXE9mB+fefNxXOjFhuAd8l9jKw6zikZ48W/TIWGav?= =?us-ascii?q?DGq7oYhewOAmK51wXv8QVYROXgWZMS9rZI6wXIWLITLwJjszpU+c=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AMdotua02tTX0AwwoyLJmZwqjBFYkLtp133Aq?= =?us-ascii?q?2lEZdPRUGvbo9fxG+85rrCMc6QxhPk3I9uruBEDtewK5yXcx2/h3AV7AZmfbUQ?= =?us-ascii?q?mTQL2KhLGKq1aLdhEWtNQtsJuIGJIfNDSfNykYsS+32miF+sgbsaS62ZHtleHD?= =?us-ascii?q?1G1sUA0vT6lh6j1yAgGdHlYefng8ObMJUIqb+tFcpyetPVAebsGADHEDWOTZ4/?= =?us-ascii?q?LRkpaOW299OzcXrBmJkSiz6KP3VzyR3hIlWTtJxrs4tUjp+jaJnpmejw=3D=3D?= X-IronPort-AV: E=Sophos;i="5.88,333,1635177600"; d="scan'208";a="124189362" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 12 May 2022 20:27:17 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 0124C4D1716B; Thu, 12 May 2022 20:27:13 +0800 (CST) Received: from G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 12 May 2022 20:27:13 +0800 Received: from [192.168.22.28] (10.167.225.141) by G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Thu, 12 May 2022 20:27:10 +0800 Message-ID: <32f51223-c671-1dc0-e14a-8887863d9071@fujitsu.com> Date: Thu, 12 May 2022 20:27:12 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCHSETS] v14 fsdax-rmap + v11 fsdax-reflink To: Dan Williams , "Darrick J. Wong" CC: Andrew Morton , Dave Chinner , Linux Kernel Mailing List , linux-xfs , Linux NVDIMM , Linux MM , linux-fsdevel , Christoph Hellwig , Jane Chu , Goldwyn Rodrigues , Al Viro , Matthew Wilcox , Naoya Horiguchi , References: <20220508143620.1775214-1-ruansy.fnst@fujitsu.com> <20220511000352.GY27195@magnolia> <20220511014818.GE1098723@dread.disaster.area> <20220510192853.410ea7587f04694038cd01de@linux-foundation.org> <20220511024301.GD27195@magnolia> <20220510222428.0cc8a50bd007474c97b050b2@linux-foundation.org> <20220511151955.GC27212@magnolia> From: Shiyang Ruan In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-yoursite-MailScanner-ID: 0124C4D1716B.A2F85 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/5/11 23:46, Dan Williams 写道: > On Wed, May 11, 2022 at 8:21 AM Darrick J. Wong wrote: >> >> Oan Tue, May 10, 2022 at 10:24:28PM -0700, Andrew Morton wrote: >>> On Tue, 10 May 2022 19:43:01 -0700 "Darrick J. Wong" wrote: >>> >>>> On Tue, May 10, 2022 at 07:28:53PM -0700, Andrew Morton wrote: >>>>> On Tue, 10 May 2022 18:55:50 -0700 Dan Williams wrote: >>>>> >>>>>>> It'll need to be a stable branch somewhere, but I don't think it >>>>>>> really matters where al long as it's merged into the xfs for-next >>>>>>> tree so it gets filesystem test coverage... >>>>>> >>>>>> So how about let the notify_failure() bits go through -mm this cycle, >>>>>> if Andrew will have it, and then the reflnk work has a clean v5.19-rc1 >>>>>> baseline to build from? >>>>> >>>>> What are we referring to here? I think a minimal thing would be the >>>>> memremap.h and memory-failure.c changes from >>>>> https://lkml.kernel.org/r/20220508143620.1775214-4-ruansy.fnst@fujitsu.com ? >>>>> >>>>> Sure, I can scoot that into 5.19-rc1 if you think that's best. It >>>>> would probably be straining things to slip it into 5.19. >>>>> >>>>> The use of EOPNOTSUPP is a bit suspect, btw. It *sounds* like the >>>>> right thing, but it's a networking errno. I suppose livable with if it >>>>> never escapes the kernel, but if it can get back to userspace then a >>>>> user would be justified in wondering how the heck a filesystem >>>>> operation generated a networking errno? >>>> >>>> most filesystems return EOPNOTSUPP rather enthusiastically when >>>> they don't know how to do something... >>> >>> Can it propagate back to userspace? >> >> AFAICT, the new code falls back to the current (mf_generic_kill_procs) >> failure code if the filesystem doesn't provide a ->memory_failure >> function or if it returns -EOPNOSUPP. mf_generic_kill_procs can also >> return -EOPNOTSUPP, but all the memory_failure() callers (madvise, etc.) >> convert that to 0 before returning it to userspace. >> >> I suppose the weirder question is going to be what happens when madvise >> starts returning filesystem errors like EIO or EFSCORRUPTED when pmem >> loses half its brains and even the fs can't deal with it. > > Even then that notification is not in a system call context so it > would still result in a SIGBUS notification not a EOPNOTSUPP return > code. The only potential gap I see are what are the possible error > codes that MADV_SOFT_OFFLINE might see? The man page is silent on soft > offline failure codes. Shiyang, that's something to check / update if > necessary. According to the code around MADV_SOFT_OFFLINE, it will return -EIO when the backend is NVDIMM. Here is the logic: madvise_inject_error() { ... if (MADV_SOFT_OFFLINE) { ret = soft_offline_page() { ... /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ page = pfn_to_online_page(pfn); if (!page) { put_ref_page(ref_page); return -EIO; } ... } } else { ret = memory_failure() } return ret } -- Thanks, Ruan.