Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp103032ybt; Tue, 16 Jun 2020 17:57:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5b6jG//bdCnR38zvy2NiR3PJFj365OiLUc/W5qGzFtfYvHkGmpmzt1epP+ho9bw1xi/uz X-Received: by 2002:a05:6402:3c1:: with SMTP id t1mr5122051edw.350.1592355433003; Tue, 16 Jun 2020 17:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592355432; cv=none; d=google.com; s=arc-20160816; b=WOWLllgOGfiIKFkgMXmPFYxCPm7au5/8b6AeP930biLqC2Bn6AoRIrkYztawyZXW8E ZJs8ghkagfIUhUjiwDgWN6kYQR/IllHyw2RMQ+OjPWXfdHewIxjJ+fe/8Kxx7Aw8ldps 3UFXZoyYh9z+llLgLZdae5XMLuaaWSuEqa7lj2X/1gLVDfOqLKJWnhKFDaqTdhnKuVaf jRJFcltyoBfsuDbFBoAfMm3wOz202l7n4nRDMjwMkuHPpKre6gfWfFkM06SYHcYk+11Q dg/rtGYbaSdqPbc9MGKjz/k4fuy1QJ2oGeYj2QKgVMEp+9tLWttXMsx1xqlgiTVKI8ol 4WVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=ZxIKXpek8EtrSTOijh5BVlsFWbPLF8rQz9Vs920UvYo=; b=CCFWZjbjdwaUkrLJ6bxa9ZFbr01g4CMhqfYNMHRwZn7bMXPI0FKjcdup4EJHF3QVuK 8bARs0K19SKWmxehm2grbHjipWMcwdAOXDwLCO9NX8v4qGnxVUb3eJC1PoLPxC5CRV57 NoeT8R2HL/364UbHdKBX2/v7RmbPZzUPMXUZzkMM/W1HJ/SGRn9HkBbqwHnUsF32TZyT cA7C+J9/0WmrsTsPHFFc2gXTZ8ABY/4dIDU+ZrJc686TPkfFEuap+xiSqSr5g+qwbQej X63Q0YiJiCOlL+IrDtyJAif9iclmYAbhw5wgmC3tL1eSUV1FFozTOY3LPclB2yhaJYgx RDdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=X9ymJOnv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j28si11257103edy.293.2020.06.16.17.56.50; Tue, 16 Jun 2020 17:57:12 -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; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=X9ymJOnv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbgFQAyw (ORCPT + 99 others); Tue, 16 Jun 2020 20:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQAyw (ORCPT ); Tue, 16 Jun 2020 20:54:52 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BEE9C061573; Tue, 16 Jun 2020 17:54:52 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49mmn31DRrz9sRR; Wed, 17 Jun 2020 10:54:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1592355289; bh=Tt4ck1L8nY61ACyfCaQSk9IvU7WHJrdCNXj+0siSSyg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=X9ymJOnvys9Xta0MkoWBUczKpvqc1UyN/Q9aQyWmLXe1VKUTEmNDQSj0rsR9Q534F p6Cep2OQrqfnlebt9PQxQzVrQBhhGf8vxbnkZ2KkloITdv6wE3e3fWf2KzjAQ/3rHv 4Rf2KtyRVAUQ0TfXasgP2KtS5MyWwwXfSxOEHZFxwBGwJ77QG/uKkxjIM9la7HY3Yo s6mWsZ+5Aa9gVpDy6HW9lFlvnILbbuGiSBVRHnfji5SIv8PgYQDi4XcBz//pG5rD8Z yHLXPGR8ugwb3hM4yDbup0N8aruEnPrwavrRY0cCsW8tvoiEuDekDUjg2hB93vQcq9 r0IQCg06h+QGQ== From: Michael Ellerman To: Linus Torvalds , Peter Xu Cc: Linux Kernel Mailing List , Gerald Schaefer , Andrew Morton , Andrea Arcangeli , openrisc@lists.librecores.org, linux-arch , Alexander Gordeev , linux-s390 , Will Deacon , Catalin Marinas , Linux ARM Subject: Re: [PATCH 00/25] mm: Page fault accounting cleanups In-Reply-To: References: <20200615221607.7764-1-peterx@redhat.com> Date: Wed, 17 Jun 2020 10:55:14 +1000 Message-ID: <87imfqecjx.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On Mon, Jun 15, 2020 at 3:16 PM Peter Xu wrote: >> This series tries to address all of them by introducing mm_fault_accounting() >> first, so that we move all the page fault accounting into the common code base, >> then call it properly from arch pf handlers just like handle_mm_fault(). > > Hmm. > > So having looked at this a bit more, I'd actually like to go even > further, and just get rid of the per-architecture code _entirely_. > One detail worth noting: I do wonder if we should put the > > perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr); > > just in the arch code at the top of the fault handling, and consider > it entirely unrelated to the major/minor fault handling. The > major/minor faults fundamnetally are about successes. But the plain > PERF_COUNT_SW_PAGE_FAULTS could be about things that fail, including > things that never even get to this point at all. Yeah I think we should keep it in the arch code at roughly the top. If it's moved to the end you could have a process spinning taking bad page faults (and fixing them up), and see no sign of it from the perf page fault counters. cheers