Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4535561ybz; Tue, 28 Apr 2020 13:08:11 -0700 (PDT) X-Google-Smtp-Source: APiQypJYd44r7JtA2+m9Qwumm3U/SnK4YSsSIOybkW4i6MPWxgB/trFTYkaHrTtdiu5nvOPwhpcO X-Received: by 2002:a17:906:35d0:: with SMTP id p16mr25452129ejb.77.1588104491045; Tue, 28 Apr 2020 13:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588104491; cv=none; d=google.com; s=arc-20160816; b=g3C80mXbAxOfbBYA9JJ7kn290Vw84+pXIMeJawvokEJH2kSRSBBhqgqug5VWeMRWcE VPKBVJ3+tGsItBu2SNs4iLD19lk/WeOs2NtN4+9+7FqMjxEMOXxmd0wJfbc8/SGrWJ5R ce4cr+aUbMIQM4i94k15Hzt3xMYct1rrTlR7IIFry3RE6MO7Fygk7Obva/5yP9h4XA13 +om623yfi4yknS9ZC2bawbzy/FCkbD76f2gHRe0/LraV2yOp7Srs3O/O+hW1/mUF1Ta0 AFK3d8CeM7FmZvFd0IzATjPTSQfLkPBnsbSc/vCn88UupibqfAPGuWi7YdVmzAXn8UVZ 7TZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=8gg0Eu1tpge+MjdKWjKLfD+fK6TW3vKdtHrWy4Lhe10=; b=Pq2R99sr4YDVph8DtIUsxVlZaJBKMEa5Z1oPY+ygdFtxCtVWE8B164NcnFcPQhFIuj t/hou7xSXlP3A0DRDbOjket+wR8LLsQUZAFTrmhHzSzud0sz/znxgsEVxJYMR36eEu/e CPpBvTHnBRqhn1GF6adRFcBI01x2L1c2T4oaQWBBSWxpYUKGDiFotPP933oB4aHM2rqv fR5Xs6Ont5KMWGJxwCLE69RnUgA6SAsvh5axccXn6lxzGgQWOUfK+hGKX2yFMMPnY9Zz eB/TlwY4ZmV7U1dtSXbdtlqEcifwGHB288g6A4zHxVexIVHgItwA/n/znL3v2xEYQfat Kx/Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rl12si2529009ejb.199.2020.04.28.13.07.26; Tue, 28 Apr 2020 13:08:11 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbgD1UEI (ORCPT + 99 others); Tue, 28 Apr 2020 16:04:08 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33113 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgD1UEI (ORCPT ); Tue, 28 Apr 2020 16:04:08 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03SK36Tq047878; Tue, 28 Apr 2020 16:03:48 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mguwbyf9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 16:03:48 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 03SK3mTe049546; Tue, 28 Apr 2020 16:03:48 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 30mguwby7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 16:03:47 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03SJtiKC021767; Tue, 28 Apr 2020 20:03:35 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma02fra.de.ibm.com with ESMTP id 30mcu7w43m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 20:03:35 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03SK3Wbl27787350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 20:03:32 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78A9511C04C; Tue, 28 Apr 2020 20:03:32 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4396511C04A; Tue, 28 Apr 2020 20:02:49 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.145.188.137]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 28 Apr 2020 20:02:48 +0000 (GMT) Subject: Re: [PATCH v4 2/2] mm/gup/writeback: add callbacks for inaccessible pages To: Dave Hansen , Claudio Imbrenda Cc: Peter Zijlstra , Andy Lutomirski , linux-next@vger.kernel.org, akpm@linux-foundation.org, jack@suse.cz, kirill@shutemov.name, "Edgecombe, Rick P" , Sean Christopherson , david@redhat.com, aarcange@redhat.com, linux-mm@kvack.org, frankja@linux.ibm.com, sfr@canb.auug.org.au, jhubbard@nvidia.com, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Will Deacon , "Williams, Dan J" References: <20200306132537.783769-1-imbrenda@linux.ibm.com> <20200306132537.783769-3-imbrenda@linux.ibm.com> <3ae46945-0c7b-03cd-700a-a6fe8003c6ab@intel.com> <20200415221754.GM2483@worktop.programming.kicks-ass.net> <20200416141547.29be5ea0@p-imbrenda> <20200416165900.68bd4dba@p-imbrenda> <20200416183431.7216e1d1@p-imbrenda> <396a4ece-ec66-d023-2c7e-f09f84b358bc@intel.com> <42fccd01-7e16-b18f-cd81-4040857d80d4@intel.com> From: Christian Borntraeger Autocrypt: addr=borntraeger@de.ibm.com; prefer-encrypt=mutual; keydata= xsFNBE6cPPgBEAC2VpALY0UJjGmgAmavkL/iAdqul2/F9ONz42K6NrwmT+SI9CylKHIX+fdf J34pLNJDmDVEdeb+brtpwC9JEZOLVE0nb+SR83CsAINJYKG3V1b3Kfs0hydseYKsBYqJTN2j CmUXDYq9J7uOyQQ7TNVoQejmpp5ifR4EzwIFfmYDekxRVZDJygD0wL/EzUr8Je3/j548NLyL 4Uhv6CIPf3TY3/aLVKXdxz/ntbLgMcfZsDoHgDk3lY3r1iwbWwEM2+eYRdSZaR4VD+JRD7p8 0FBadNwWnBce1fmQp3EklodGi5y7TNZ/CKdJ+jRPAAnw7SINhSd7PhJMruDAJaUlbYaIm23A +82g+IGe4z9tRGQ9TAflezVMhT5J3ccu6cpIjjvwDlbxucSmtVi5VtPAMTLmfjYp7VY2Tgr+ T92v7+V96jAfE3Zy2nq52e8RDdUo/F6faxcumdl+aLhhKLXgrozpoe2nL0Nyc2uqFjkjwXXI OBQiaqGeWtxeKJP+O8MIpjyGuHUGzvj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M1womzJVRfYauWhYiW/KeECklci4TPBDNx7YhahSUlexfoftltJA8swRshNA/M90/ i9zDo9ySSZHwsGxG06ZOH5/MzG6HpLja7g8NTgA0TD5YaFm/oOnsQVsf2DeAGPS2xNirmknD jaqYefx7yQ7FJXXETd2uVURiDeNEFhVZWb5CiBJM5c6qQMhmkS4VyT7/+raaEGgkEKEgHOWf ZDP8BHfXtszHqI3Fo1F4IKFo/AP8GOFFxMRgbvlAs8z/+rEEaQYjxYJqj08raw6P4LFBqozr nS4h0HDFPrrp1C2EMVYIQrMokWvlFZbCpsdYbBI= Message-ID: <929f7d1f-0cc8-e140-6f74-4797704e5185@de.ibm.com> Date: Tue, 28 Apr 2020 22:02:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <42fccd01-7e16-b18f-cd81-4040857d80d4@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-28_12:2020-04-28,2020-04-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 clxscore=1011 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 phishscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.04.20 21:43, Dave Hansen wrote: > On 4/21/20 2:31 PM, Dave Hansen wrote: >> On 4/16/20 12:02 PM, Dave Hansen wrote: >>> On 4/16/20 9:34 AM, Claudio Imbrenda wrote: >>>>> Ahh, so this is *just* intended to precede I/O done on the page, when >>>>> a non-host entity is touching the memory? >>>> yep >>> OK, so we've got to do an action that precedes *all* I/O to a page. >>> That's not too bad. >>> >>> I still don't understand how this could work generally, though There >>> are lots of places where I/O is done to a page without either going >>> through __test_set_page_writeback() or gup() with FOLL_PIN set. >>> >>> sendfile() is probably the best example of this: >>> >>> fd = open("/normal/ext4/file", O_RDONLY); >>> sendfile(socket_fd, fd, &off, count); >>> >>> There's no gup in sight since the file doesn't have an address and it's >>> not being written to so there's no writeback. >>> >>> How does sendfile work? >> >> Did you manage to see if sendfile works (or any other operation that >> DMAs file-backed data without being preceded by a gup)? > > It's been a couple of weeks with no response on this. > > From where I'm standing, we have a hook in the core VM that can't > possibly work with some existing kernel functionality and has virtually > no chance of getting used on a second architecture. > > It sounds like there may need to be some additional work here, but > should these hooks stay in for 5.7? Or, should we revert this patch and > try again for 5.8? We have something and Claudio is going to send out an addon patch soon. Reverting would be harmful basically allowing for I/O errors on a valid path that can happen with normal use. The sendfile case is also valid, but it only triggers for a handcrafted cases (you have to change QEMU to use MAP_SHARED and you have to use a file as memory backing and you have to splice this file then to another file that is using DIRECT_IO). Those cases then run into an I/O error case that is recovered by the driver. the same would not work for a swap backing. It is also not trivial (or doable) to change all device drivers that exist on s390 to use the DMA API. In the long run we might be able to get the necessary changes into the DMA api. Claudio will send the details tomorrow.