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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 2F245C433E0 for ; Mon, 10 Aug 2020 19:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08AFC21775 for ; Mon, 10 Aug 2020 19:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597086248; bh=SxC2tO5iLrmX9Nq57Li/7eH8NZGQlkKhJ+2SC8dUU2c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=b1nvBGyOi6kOy3EQL7R0pi2WsOemg6Lm0siwYkA297zDIhvOe2z1nKxoaosQwDcK6 JX7/H2m6aFa0GerY8Ci1FQ9j/gvAer6n16QesuUfme1xUO3KI30/qGcAGHkHL40HCv PG4uQDXS1p5G5VHclEES4BM/N0jTvrUTz+nJP7z0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728215AbgHJTEH (ORCPT ); Mon, 10 Aug 2020 15:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728177AbgHJTEH (ORCPT ); Mon, 10 Aug 2020 15:04:07 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98C8AC061756 for ; Mon, 10 Aug 2020 12:04:06 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id h19so10776987ljg.13 for ; Mon, 10 Aug 2020 12:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=znZF7mN4GZa7I95wRQzCZYfOmWM4zcoHpG47PvAps1U=; b=XUJQHnTApaapFJwiD/BK36p+cwXWA+5VUkYEfyWWZ/6mgtkmnboJDj6aIUoioBVyPJ OLqiFTmnWZbmAEv8s98Nvcp1U+JKND7W3WrzVdKMnAE18WAMXRo1u68m44Lt/tRYstoq oMkbTLobdgkHSjFkZxhHiaKKxen95T6oCkO7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=znZF7mN4GZa7I95wRQzCZYfOmWM4zcoHpG47PvAps1U=; b=gJbBlnxT7kp/L4M25vz9tsfubNwx/0Jqe60NPaO4gL+mTDDQtFVODKaQ/0X0ZSWUYB yWIdf+dS3N6TNbodoczLqyBieXB2VnxWLLQ0I0AmrHnPl2PPu7vDHQg1lALWnrIKTIGM WdcSoisl4ZUaMtMNe1YechwRDchS/0S7Kc/4c2E4L+mwFeyynEnWyLgqfBhex/kgWER3 KXEm0BjtwroGeIpA7T1M+dIb+qbFlwrVQfSzh98BqPWjLNakYYsuHYMOkySvFRRMui1E LToOGHwmyVtKtIdiKsXlbJrOUIYxYih5GDWkOP/ULpAYMZ5jslfMyE4xva0nJhagmMIU wToA== X-Gm-Message-State: AOAM532tdsztDnyXQ0hJDeVe+r/I0iyARzMYH3yucDVGr8F8AwuON0h1 zQfNDDnTCwreQ8YOSLYY3DIp9kexSD0= X-Google-Smtp-Source: ABdhPJzLmP1TBc2eSqPscARpw4O/nbLWks4i8ksCgqkqS/ps31zMYLKgmJf9I2R2lwrKlmpd2ZDvSA== X-Received: by 2002:a2e:2a04:: with SMTP id q4mr1174816ljq.192.1597086244667; Mon, 10 Aug 2020 12:04:04 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id t22sm11033410lfr.12.2020.08.10.12.04.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Aug 2020 12:04:04 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id t6so10807108ljk.9 for ; Mon, 10 Aug 2020 12:04:04 -0700 (PDT) X-Received: by 2002:a05:6512:3b7:: with SMTP id v23mr1282665lfp.10.1597085867750; Mon, 10 Aug 2020 11:57:47 -0700 (PDT) MIME-Version: 1.0 References: <20200806231643.a2711a608dd0f18bff2caf2b@linux-foundation.org> <20200807061706.unk5_0KtC%akpm@linux-foundation.org> In-Reply-To: From: Linus Torvalds Date: Mon, 10 Aug 2020 11:57:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 001/163] mm/memory.c: avoid access flag update TLB flush for retried page fault To: Yang Shi Cc: Andrew Morton , Catalin Marinas , Johannes Weiner , Hillf Danton , Hugh Dickins , Josef Bacik , "Kirill A . Shutemov" , Linux-MM , mm-commits@vger.kernel.org, stable , Will Deacon , Matthew Wilcox , Yu Xu , Yang Shi Content-Type: text/plain; charset="UTF-8" Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Mon, Aug 10, 2020 at 10:48 AM Yang Shi wrote: > > It looks the retried fault still flush TLB with this change. > > Shouldn't we do something like this to skip spurious TLB flush: I have no idea what code-base you're basing your patches against, and what you're comparing my patch. Your patch does *exactly* the same thing mine did. Except it does a "goto unlock" to jump over the flush_tlb_fix_spurious_fault(), while my pseudo-patch just changed the if (vmf->flags & FAULT_FLAG_WRITE) to be a if (vmf->flags & (FAULT_FLAG_WRITE | FAULT_FLAG_TRIED)) but it has the same effect: it skips the flush_tlb_fix_spurious_fault(). So if you think your patch does something else, then your source code doesn't match mine. The *only* thing you jumped over was that same thing that I disabled. Somebody is confused. Linus 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=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 07735C433DF for ; Mon, 10 Aug 2020 18:57:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B0B020774 for ; Mon, 10 Aug 2020 18:57:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="XUJQHnTA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B0B020774 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A1DFE6B0002; Mon, 10 Aug 2020 14:57:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CE6A6B0003; Mon, 10 Aug 2020 14:57:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BDAA6B0006; Mon, 10 Aug 2020 14:57:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 74F326B0002 for ; Mon, 10 Aug 2020 14:57:53 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F3E458248047 for ; Mon, 10 Aug 2020 18:57:52 +0000 (UTC) X-FDA: 77135568426.03.magic70_3401dd426fdc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id C4E7E28A4E8 for ; Mon, 10 Aug 2020 18:57:52 +0000 (UTC) X-HE-Tag: magic70_3401dd426fdc X-Filterd-Recvd-Size: 4875 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Aug 2020 18:57:52 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id d2so5305587lfj.1 for ; Mon, 10 Aug 2020 11:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=znZF7mN4GZa7I95wRQzCZYfOmWM4zcoHpG47PvAps1U=; b=XUJQHnTApaapFJwiD/BK36p+cwXWA+5VUkYEfyWWZ/6mgtkmnboJDj6aIUoioBVyPJ OLqiFTmnWZbmAEv8s98Nvcp1U+JKND7W3WrzVdKMnAE18WAMXRo1u68m44Lt/tRYstoq oMkbTLobdgkHSjFkZxhHiaKKxen95T6oCkO7s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=znZF7mN4GZa7I95wRQzCZYfOmWM4zcoHpG47PvAps1U=; b=lGv6w0eyrMaKeJkENjexvhuj+y0R8uOTgfXhJDHu0zW+BCFt+Zgv2+DJbHvyVC/II9 Jyjr/wTKN4DesJb1MsJ1suZGZ1AXvPSvM5sE7rqHxtFyn4kF6x4Uj8i1finehVMxv5Hd b/EPTNoUDNewpf5TUB6Ko/rf9hA6Yio9mTTWjxjhCZ5ERDxRK10TWVHeZBzUNx2GIwlP NS5JxZ8V0JndfzegR859oPNSD+IdxAQ6FKzFxOvVwGIyU7HaeQV03YFBZszSchri5jGj D3f2c3EUaTSt42hN8MwWPEZTxuVSc8bUkGLHXA4gRO1pjXHAGYePUVC7MzotNu0SQDdi haUw== X-Gm-Message-State: AOAM5302S7mW/6rQ/n02/QVKkzaJJy5kjt3bX98naymavyh5fNDbES5n l+3ICBqL+VMK6Xp+CZSrL0+5xAlZgkg= X-Google-Smtp-Source: ABdhPJxzdZxda1Df1qCUdjQVS6i5Jzh2zLTqdkgaMJKpdlM7AA6BcIDWaTNZ2bnTIh6R8TzqNiXEDw== X-Received: by 2002:a19:43:: with SMTP id 64mr1247629lfa.72.1597085869945; Mon, 10 Aug 2020 11:57:49 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id a9sm9392572ljb.57.2020.08.10.11.57.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Aug 2020 11:57:48 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id m15so5294891lfp.7 for ; Mon, 10 Aug 2020 11:57:48 -0700 (PDT) X-Received: by 2002:a05:6512:3b7:: with SMTP id v23mr1282665lfp.10.1597085867750; Mon, 10 Aug 2020 11:57:47 -0700 (PDT) MIME-Version: 1.0 References: <20200806231643.a2711a608dd0f18bff2caf2b@linux-foundation.org> <20200807061706.unk5_0KtC%akpm@linux-foundation.org> In-Reply-To: From: Linus Torvalds Date: Mon, 10 Aug 2020 11:57:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch 001/163] mm/memory.c: avoid access flag update TLB flush for retried page fault To: Yang Shi Cc: Andrew Morton , Catalin Marinas , Johannes Weiner , Hillf Danton , Hugh Dickins , Josef Bacik , "Kirill A . Shutemov" , Linux-MM , mm-commits@vger.kernel.org, stable , Will Deacon , Matthew Wilcox , Yu Xu , Yang Shi Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: C4E7E28A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Mon, Aug 10, 2020 at 10:48 AM Yang Shi wrote: > > It looks the retried fault still flush TLB with this change. > > Shouldn't we do something like this to skip spurious TLB flush: I have no idea what code-base you're basing your patches against, and what you're comparing my patch. Your patch does *exactly* the same thing mine did. Except it does a "goto unlock" to jump over the flush_tlb_fix_spurious_fault(), while my pseudo-patch just changed the if (vmf->flags & FAULT_FLAG_WRITE) to be a if (vmf->flags & (FAULT_FLAG_WRITE | FAULT_FLAG_TRIED)) but it has the same effect: it skips the flush_tlb_fix_spurious_fault(). So if you think your patch does something else, then your source code doesn't match mine. The *only* thing you jumped over was that same thing that I disabled. Somebody is confused. Linus