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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 7F94DC433DF for ; Wed, 24 Jun 2020 20:40:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3C3A62072E for ; Wed, 24 Jun 2020 20:40:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="MEOPr96z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C3A62072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B9B516B000C; Wed, 24 Jun 2020 16:40:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B235A6B000D; Wed, 24 Jun 2020 16:40:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 99D5F6B0010; Wed, 24 Jun 2020 16:40:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 7CF096B000C for ; Wed, 24 Jun 2020 16:40:56 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EBD80181ABE88 for ; Wed, 24 Jun 2020 20:40:55 +0000 (UTC) X-FDA: 76965274470.22.game76_4104c5026e47 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id C01A018038E60 for ; Wed, 24 Jun 2020 20:40:55 +0000 (UTC) X-HE-Tag: game76_4104c5026e47 X-Filterd-Recvd-Size: 6005 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 20:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593031254; h=from:from:reply-to:subject:subject: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=s/Q+RsZBYMOAhrMPCGGxWYAFNZoQJnDuY4/Qu5DbXBw=; b=MEOPr96z+JU79h1pJpCMWamcE4xJC1SFrHv2AwnALJvvb2M+cN//w/PlR0gDwSZJ+MZrZt wC1VjWL6a2IJCbjXqFC8Ttfaq1UBmhEAhcC14as1kpkXEbAVgLzcrJR1AhPfMDDFllrn+l I3nAVbHN8EM/JlEmjq/f/RjNUhKQfyY= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-K6Nm8jDzMJC-ZjOfA57YiA-1; Wed, 24 Jun 2020 16:40:50 -0400 X-MC-Unique: K6Nm8jDzMJC-ZjOfA57YiA-1 Received: by mail-qt1-f198.google.com with SMTP id p9so2458464qtn.5 for ; Wed, 24 Jun 2020 13:40:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=s/Q+RsZBYMOAhrMPCGGxWYAFNZoQJnDuY4/Qu5DbXBw=; b=b7SyoZ2U7HTGyR1shGDqPt67mGfylwan428dDNlb1EiheyEbUp3fMx0n75t3gkB9/P 451FeM6j311WpiJZr9+W9JD2cJrhhp8DTDlf8jpcx8Ob1cvZorhi/vRP1oSj4yi+rK// qpMP/doybHfaRTbmJBAWIvfBwmjCuVZgiFRrEZmDHNdSijf7cRXOCR9Umz8t6Q02X60k tmt3mpO9+oPNAxLhtWqhyB9Iuhu5amX9a7Ipw33URgFfybrth7EpAZrfufTnKtNiMmFU QLAzK6uC76Shu3CyRHJN55DAfwLMkSfiriqENT+BhCv4VrCmYk3g2dDX9ZGCWSN0sGv0 uSUA== X-Gm-Message-State: AOAM532TCMHj3baGAjsQmxxapDtQZlugfaUpNNQht0AHp/x7dasSP6Rr 4ZB/EZHIy1GWb7x/Nwlmi4wVu5YQert1iclwTcD3OuMB3W/V1hzSrqKo0tqY21JlSMcKLaPK8+G Cxd5JcVV5yFc= X-Received: by 2002:ac8:4d4d:: with SMTP id x13mr27918967qtv.289.1593031250300; Wed, 24 Jun 2020 13:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDdof3kQnRWMH/ZuwYgHnSQWiMQJJVG8ff1Lps2dKtAX8O4FtVpVCamC1ozXzBQ9kDQ5TqUw== X-Received: by 2002:ac8:4d4d:: with SMTP id x13mr27918944qtv.289.1593031250075; Wed, 24 Jun 2020 13:40:50 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id p3sm4444095qtl.21.2020.06.24.13.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 13:40:49 -0700 (PDT) Date: Wed, 24 Jun 2020 16:40:47 -0400 From: Peter Xu To: Gerald Schaefer Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Andrea Arcangeli , Will Deacon , Michael Ellerman , Linus Torvalds , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-s390@vger.kernel.org Subject: Re: [PATCH 18/26] mm/s390: Use general page fault accounting Message-ID: <20200624204047.GC64004@xz-x1> References: <20200619160538.8641-1-peterx@redhat.com> <20200619161335.9664-1-peterx@redhat.com> <20200624204930.2445bcd6@thinkpad> MIME-Version: 1.0 In-Reply-To: <20200624204930.2445bcd6@thinkpad> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: C01A018038E60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Wed, Jun 24, 2020 at 08:49:30PM +0200, Gerald Schaefer wrote: > On Fri, 19 Jun 2020 12:13:35 -0400 > Peter Xu wrote: > > > Use the general page fault accounting by passing regs into handle_mm_fault(). > > It naturally solve the issue of multiple page fault accounting when page fault > > retry happened. > > > > CC: Heiko Carstens > > CC: Vasily Gorbik > > CC: Christian Borntraeger > > CC: linux-s390@vger.kernel.org > > Signed-off-by: Peter Xu > > --- > > arch/s390/mm/fault.c | 16 +--------------- > > 1 file changed, 1 insertion(+), 15 deletions(-) > > > > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c > > index ab6d7eedcfab..4d62ca7d3e09 100644 > > --- a/arch/s390/mm/fault.c > > +++ b/arch/s390/mm/fault.c > > @@ -479,7 +479,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) > > * make sure we exit gracefully rather than endlessly redo > > * the fault. > > */ > > - fault = handle_mm_fault(vma, address, flags, NULL); > > + fault = handle_mm_fault(vma, address, flags, regs); > > if (fault_signal_pending(fault, regs)) { > > fault = VM_FAULT_SIGNAL; > > if (flags & FAULT_FLAG_RETRY_NOWAIT) > > @@ -489,21 +489,7 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) > > if (unlikely(fault & VM_FAULT_ERROR)) > > goto out_up; > > There are two cases here where we skipped the accounting, > fault_signal_pending() and VM_FAULT_ERROR, similar to other archs. > > fault_signal_pending() should be ok, because that only seems to be true > for fault & VM_FAULT_RETRY, in which case the new approach also skips > the accounting. IMHO it's still possible to have fault_signal_pending() return true even if the fault is not with VM_FAULT_RETRY, e.g., when the signal is delivered right after the fault is correctly handled for the thread. However I hope we can avoid considering that too even if so... > > But for VM_FAULT_ERROR, the new approach would do accounting, IIUC. Is > that changed on purpose? See also my reply on [PATCH 01/26]. (replied in the other thread) Thanks, -- Peter Xu