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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 4F2D1C433E1 for ; Tue, 16 Jun 2020 16:00:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C0CB20776 for ; Tue, 16 Jun 2020 16:00:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rDyKDJAW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bT0HTOvX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C0CB20776 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TNTJwqtSNe6mf12+lmisF8oLNYMnFlZet07ynAiX98k=; b=rDyKDJAWNJA2dr EHS/0qoePLoZJyryy/F7aCIgKpU2p5ewgOfW/WEg9Hnu47dklAdBVj1gX1HfbeUmekp4RmnMxyYyb 1WrGJRdlF0dzyF0VB9PXlpU6mr5Hy2vEViIiWoh4IC+ZZJRy/afKXP7wpEfIdJ2ZhPqj+Nq8wo4wZ W83iRqXC/UrV18m1j8k52ndok5wbf2Htwt9PgiGkEKZ0VwOLRr37gcd/YaTVVpNnxWSihWXhGDRRF sYx+71PLCV7OPZcrl6yzGv+iAV3ZgpQDIR02h9evx6sc9BeF5ZRiFrTX1ElJMBTztSit5kbVbyzhv pO7T0LX7ourjY593yuJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlE0Z-0006fS-IX; Tue, 16 Jun 2020 16:00:19 +0000 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlDze-0004C8-Gw for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2020 15:59:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592323161; 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=5Gc0Dg29WyIqBxMjGZGdoDeYitc04zw+8Uk/3lb0oUU=; b=bT0HTOvX7SlMU628ugkPMVhaTKAhm0p4uIeekRPBvNlhSihwE8P6e4ualmbbJnRLKayi4w KaofhGQmWZmo1IFaJnA92mMwwg+KNpo7reeVC4eI8gnCa0ec/RLmLtbc9dezCSvMBYyItf ycWZ2vTFA+L94hNaujLB0K7q/rrnIUI= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-496-qHF1zSjAOAK8LSXflAsw7w-1; Tue, 16 Jun 2020 11:59:17 -0400 X-MC-Unique: qHF1zSjAOAK8LSXflAsw7w-1 Received: by mail-qv1-f72.google.com with SMTP id 59so15909367qvb.4 for ; Tue, 16 Jun 2020 08:59:17 -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=5Gc0Dg29WyIqBxMjGZGdoDeYitc04zw+8Uk/3lb0oUU=; b=P9At7hmj8dKi988Tnn9ZNnhMcSJgQaQPr47aaMOEZGGtBLOHyLu9tau2ebhmmEd8Mc gGUcMRlFXN78ZMXRQLcQthhnyXu5kRikdsmRnyDNlD2akMpswY7v3MHbXMGHy62AVP4A mAopzgFSN9hrMGRCkitQ82ESK9mHwNF2I49vJm8y6CJA7+MfTrtTbGiLlUgvsYlg9tjl vwkfi0pGSSXKH3CsRdi4z2IBac2DoQ6HG6Fmnn9gLAqJn1qzHhmXDFf46JK5/JU3ZWTX U3Jq2AApcQavejzvrcB5T9jVIlnoBkojNwGQB5U8PuOk77g4MzE/u+CSg2V7LVyF88mp CTTA== X-Gm-Message-State: AOAM532QiSQ+LK4O+p88SXS1O9pUWdXtaQQYQF2DWhj5bbU5SJUmbk5s TC/Q1RQ9SB0nShXkDDvr8YyPGt5WIxbVAp55ycIPynuIZf4qFyRVvF6oKVEU1upaZH/++YCShJU N13Mn4+UD/8UcSsu/okkXVx+Ug20Xy7W3ShE= X-Received: by 2002:a37:6f02:: with SMTP id k2mr20702246qkc.129.1592323157178; Tue, 16 Jun 2020 08:59:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+CJxAHuYkrcTeCwjCPlS1h0Nvk5LsJIDdZuRwaKtc+dpfMVU5ZGkZ12CkR4olUnzdv9Abeg== X-Received: by 2002:a37:6f02:: with SMTP id k2mr20702225qkc.129.1592323156891; Tue, 16 Jun 2020 08:59:16 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id 123sm154267qkj.56.2020.06.16.08.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 08:59:15 -0700 (PDT) Date: Tue, 16 Jun 2020 11:59:14 -0400 From: Peter Xu To: Will Deacon Subject: Re: [PATCH 06/25] mm/arm64: Use mm_fault_accounting() Message-ID: <20200616155914.GB11838@xz-x1> References: <20200615221607.7764-1-peterx@redhat.com> <20200615221607.7764-7-peterx@redhat.com> <20200616074307.GA1637@willie-the-truck> MIME-Version: 1.0 In-Reply-To: <20200616074307.GA1637@willie-the-truck> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200616_085922_636931_07CBE7DC X-CRM114-Status: GOOD ( 13.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrea Arcangeli , Catalin Marinas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Linus Torvalds , Gerald Schaefer Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Will, On Tue, Jun 16, 2020 at 08:43:08AM +0100, Will Deacon wrote: > Please can you explain why it's ok to move the PERF_COUNT_SW_PAGE_FAULTS > update like this? Seems like a user-visible change to me, so some > justification would really help. Indeed this could be a functional change for PERF_COUNT_SW_PAGE_FAULTS on some archs, e.g., for arm64, PERF_COUNT_SW_PAGE_FAULTS previously will also contain accounting of severe errors where we go into the "no_context" path. However if you see the other archs, it's not always true, for example, the xtensa arch only accounts the correctly handled faults (arch/xtensa/mm/fault.c). After I thought about this, I don't think it's extremely useful (or please correct me if I missed something important) to use PERF_COUNT_SW_PAGE_FAULTS for fatal error accountings among all those correct ones. After all they are really extremely rare cases, and even if we got a sigbus for a process, we'll normally got something dumped in dmesg so if we really want to capture the error cases there should always be a better way (because by following things like dmesg we can not only know how many error faults triggered, but also on the details of the errors). IOW, my understanding of users of PERF_COUNT_SW_PAGE_FAULTS is that they want to trap normal/correct page faults, not really care about rare errors. Then when I went back to think PERF_COUNT_SW_PAGE_FAULTS, it's really about: A=PERF_COUNT_SW_PAGE_FAULTS B=PERF_COUNT_SW_PAGE_FAULTS_MAJ C=PERF_COUNT_SW_PAGE_FAULTS_MIN And: A=B+C If that's the case (which is simple and clear), it's really helpful too that we unify this definition across all the architectures, then it'll also be easier for us to provide some helper like mm_fault_accounting() so that the accounting can be managed in the general code rather than in arch-specific ways. Thanks, -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel