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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 D306DC432C0 for ; Sat, 30 Nov 2019 18:23:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 941A32073C for ; Sat, 30 Nov 2019 18:23:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="bf0MgGTi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 941A32073C 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 0B8BF6B0003; Sat, 30 Nov 2019 13:23:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 068556B0005; Sat, 30 Nov 2019 13:23:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E999F6B0006; Sat, 30 Nov 2019 13:23:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0113.hostedemail.com [216.40.44.113]) by kanga.kvack.org (Postfix) with ESMTP id D17F46B0003 for ; Sat, 30 Nov 2019 13:23:55 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 82D1945C1 for ; Sat, 30 Nov 2019 18:23:55 +0000 (UTC) X-FDA: 76213767630.17.bells17_223344665aa1d X-HE-Tag: bells17_223344665aa1d X-Filterd-Recvd-Size: 4591 Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Sat, 30 Nov 2019 18:23:54 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id e9so35247840ljp.13 for ; Sat, 30 Nov 2019 10:23:54 -0800 (PST) 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=u0JfrhdDhzTetmUD+84kClCBoBttknwfKi4pRj2979M=; b=bf0MgGTip6d1PItDL8VGeE1qaDY/j9ixz0qpAQkf5F6v9M5aNPOpI4jjr2XPxAxhcA GJKbY/6+tUCS+LVQS13ljyhVcfEbxwb3tv5e7NTZlJijMtJ6r3T+eylFOA0z7JAlzHKn R52/jRzjHqCo8LV/hAE+usMuZz8TLO3DZuEW4= 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=u0JfrhdDhzTetmUD+84kClCBoBttknwfKi4pRj2979M=; b=so6oKXPhmvRiAq1RJmK6w1SUQzBPVmF38xuZhAeY38Jmo3MM44EjjapiQjQkp+zqDN emYfJ4vD6e2ptmIDs9p9pYfkLx6NRaFTYGMhGrW3Iq2hE5Cb9UBLWSnRkFarBvf4fd1K ucOjPIhshsT0gRIJ3ZtujZd95v2blwLuViVC31sgzla248KedCPZtm8Fgdfx6BbLDfap XsccFe6GfJyj4FIyt1Zrz4EynE41lM0rOlBMw2Q9wezRXrd1Z3AA5qAsKdoPDhD/L8K/ rpPlVeRB0Jb+zHl0eChCKrj1pbgN33mV59/3PeJKgSSj5rse6ruIYpiioNwQou6QrqUo CpyA== X-Gm-Message-State: APjAAAXRxnKKO1ocOQSLLjt2zj5FWIQ+2Nbo3iUTGA5kijuGL1wVQU9W qcOuOyn5Vjk/UBaAbMXDX7smsGTW+uo= X-Google-Smtp-Source: APXvYqy0EtdBUSRqb/lvBq4SJTiNMMyHBWpeCIJYX8kE7eGWIg8rklF5NUjRWsjNNN55aYFPIo5ZCg== X-Received: by 2002:a2e:9006:: with SMTP id h6mr41238783ljg.231.1575138232998; Sat, 30 Nov 2019 10:23:52 -0800 (PST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id r20sm11445726lfi.91.2019.11.30.10.23.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Nov 2019 10:23:48 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id r15so21950128lff.2 for ; Sat, 30 Nov 2019 10:23:47 -0800 (PST) X-Received: by 2002:a19:4bd4:: with SMTP id y203mr36767338lfa.61.1575138227505; Sat, 30 Nov 2019 10:23:47 -0800 (PST) MIME-Version: 1.0 References: <20191125204248.GA2485@ziepe.ca> In-Reply-To: From: Linus Torvalds Date: Sat, 30 Nov 2019 10:23:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] Please pull hmm changes To: Jason Gunthorpe Cc: Andrew Morton , Dan Williams , Christoph Hellwig , "dri-devel@lists.freedesktop.org" , "linux-mm@kvack.org" , David Airlie , Daniel Vetter , "amd-gfx@lists.freedesktop.org" , "Kuehling, Felix" , "Deucher, Alexander" , Ralph Campbell , "linux-rdma@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" 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 Sat, Nov 30, 2019 at 10:03 AM Linus Torvalds wrote: > > I'll try to figure the code out, but my initial reaction was "yeah, > not in my VM". Why is it ok to sometimes do WRITE_ONCE(mni->invalidate_seq, cur_seq); (to pair with the unlocked READ_ONCE), and sometimes then do mni->invalidate_seq = mmn_mm->invalidate_seq; My initial guess was that latter is only done at initialization time, but at least in one case it's done *after* the mni has been added to the mmn_mm (oh, how I despise those names - I can only repeat: WTF?). See __mmu_interval_notifier_insert() in the mmn_mm->active_invalidate_ranges case. I'm guessing that it doesn't matter, because when inserting the notifier the sequence number is presumably not used until after the insertion (and any use though mmn_mm is protected by the mmn_mm->lock), but it still looks odd to me. Linus