Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1369891ybz; Thu, 16 Apr 2020 08:01:53 -0700 (PDT) X-Google-Smtp-Source: APiQypKf+lG7hOVt/JnI0Q/E80WmCG2iNg9lB1HZGBlVKHOzXfIt2SZfVcLexRveXeAYEuLkLLPb X-Received: by 2002:a50:c0ce:: with SMTP id r14mr16551678edf.298.1587049313405; Thu, 16 Apr 2020 08:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587049313; cv=none; d=google.com; s=arc-20160816; b=HSwkTDeoRVB3Wro/+0X5wPJx2UggN9XifAJJcL6/wVoaBOBMbjPKMbZ85ERNM/JfnF P5v9xW6WZDzOVOYJAo6+HauFpKbJtPmmei6THBf0AciH0vazrkDPXW14CvNpEZuQkIK/ vsb6s8Jmx/iC7AjRczvornYMltZospFbPZ/GcQtwZtT/HjweisZrmbfe/dVT12DmrkAv 38L6NM0gJpUXgJBUsrZXZp0QnC5XqTVng5qOSxq53luSPwRY6LhuRAPn9+ZLchmf0/Xv ovhEKqR+TRI7GTvUC2KKUNAur97v+3X115fM9TpgznmnXh7axJaB1Q8ravOrHXhX8VVT YkCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:organization:references:in-reply-to:subject:cc:to:from :date; bh=TBY0rrnzfJ/vr68FqrDP52FZ3qEXUxXXh1S0JhyZ7Kk=; b=YFZ/3rrgZ6qs8NCX02226h2DwR7SbPT2pZL05b6ut9kCtsYmWXowKzi2lJuvcVjgU9 c40ryAzQhhx8sUHXMv9HQA6Dia/zhkBpY0FRWaoBHrSHr8l4Boiq0n39uYCUCiJi6XtP qumeOUtp3ric7uYvv4av49fsIY10uCPJeOkKZ4lqDLkWoFvswpXOt6o/cl89JuqDkLYK lmUzZGyNGV1rSmS6XJdtrfmuETA8hm5kz+SexYcw5szIJVzzD4o/jU5WdEQpAgoQGoGF O5FsJwiN3ktdRi7OPVfjdjcZ2J7JqevEotV8PLqhKp3LrjpLEtTh0kaTWvK8qdPlu/Mm AyAw== 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 y1si13916081edp.606.2020.04.16.08.01.22; Thu, 16 Apr 2020 08:01:53 -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 S2409532AbgDPO7U (ORCPT + 99 others); Thu, 16 Apr 2020 10:59:20 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:63996 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409558AbgDPO7O (ORCPT ); Thu, 16 Apr 2020 10:59:14 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03GEX74o061412 for ; Thu, 16 Apr 2020 10:59:12 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 30erh9a0b4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Apr 2020 10:59:11 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Apr 2020 15:58:31 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 16 Apr 2020 15:58:27 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03GEx34v46596366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Apr 2020 14:59:03 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 559385205A; Thu, 16 Apr 2020 14:59:03 +0000 (GMT) Received: from p-imbrenda (unknown [9.145.0.99]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 88FAA5204E; Thu, 16 Apr 2020 14:59:02 +0000 (GMT) Date: Thu, 16 Apr 2020 16:59:00 +0200 From: Claudio Imbrenda To: Dave Hansen 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 , borntraeger@de.ibm.com, 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" Subject: Re: [PATCH v4 2/2] mm/gup/writeback: add callbacks for inaccessible pages In-Reply-To: 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> Organization: IBM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 20041614-0016-0000-0000-00000305A88E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20041614-0017-0000-0000-00003369AD2E Message-Id: <20200416165900.68bd4dba@p-imbrenda> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-16_05:2020-04-14,2020-04-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=658 impostorscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 adultscore=0 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004160105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Apr 2020 07:20:48 -0700 Dave Hansen wrote: > On 4/16/20 5:15 AM, Claudio Imbrenda wrote: > >> I assumed that this was all anonymous-only so it's always dirty > >> before writeback starts. > > it could also be mmapped > > Let's say you have a mmap()'d ramfs file. Another process calls which > doesn't have it mapped calls sys_write() and writes to the file. > > This means that host host has to write to the physical page and must > do arch_make_page_accessible() in the sys_write() path somewhere. > > There is a get_user_pages() in that path, but it's on the _source_ > buffer, not the ramfs page because the ramfs page is not mapped. > There's also no __test_set_page_writeback() because you can't write > back ramfs. > > Where is the arch_make_page_accessible() in this case on the ramfs > page? it's in the fault handler for the exception the CPU will get when attempting to write the data to the protected page