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=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 469DDC07E97 for ; Sat, 3 Jul 2021 16:57:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BE52D61930 for ; Sat, 3 Jul 2021 16:57:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE52D61930 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4E5206B0074; Sat, 3 Jul 2021 12:57:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 479F96B0075; Sat, 3 Jul 2021 12:57:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 30EE58D0002; Sat, 3 Jul 2021 12:57:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 0B0C26B0074 for ; Sat, 3 Jul 2021 12:57:34 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9306018030095 for ; Sat, 3 Jul 2021 16:57:33 +0000 (UTC) X-FDA: 78321882786.05.A1D6E16 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by imf19.hostedemail.com (Postfix) with ESMTP id 51D37B0000A7 for ; Sat, 3 Jul 2021 16:57:33 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id f21so15664520ioh.13 for ; Sat, 03 Jul 2021 09:57:33 -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=e6lHywLk8e8ZkMny6eUW/z6wvfFZ8vT2gzj9AFlMJnA=; b=O+R7GnhZWhhI19PgIZDS8jidf6g9gRYur10kyfu+JN5C9HDAFI1KA/lAMrl035jMOd /LvbptquyK6f9uMFEe1eJgCSqfwyAMEJb62eWkBXaSyNR805lt2pKkvhlwnEF5kl/XIA ylkGasRnIjgIyQrd9YlgdUWs9XfRvj4xZaeJVryvqzRtkOBrtOkoFpVntnefLpqvjG+l LmatJ97sjevznBp8f2zg6jGwcqlwzXRqNhTn7kvrv+8A0dq+PH/jVe7No7Dcj5c/yEgU HnCOqaSq1u+5c84Gk2119zNUgSiZp3e56pGurXO3a/pcLf1NqUko0faJndDiCwcEAwSf hRZw== X-Gm-Message-State: AOAM531YAmzrWhJoM5JkQknQD7t6xq6Av9MdA1yx6YLLvsZBdPFpZQrp TvZr6rSZlXnpUgCQ2SFhCb0= X-Google-Smtp-Source: ABdhPJwhHhcj4JJjokzk5P7q5Iqr3l3KZQZr2baFkVVragIyyVeD9Zy9MqlBP6hg1lhakzXXXKzPJw== X-Received: by 2002:a6b:f704:: with SMTP id k4mr4755459iog.191.1625331452666; Sat, 03 Jul 2021 09:57:32 -0700 (PDT) Received: from google.com (243.199.238.35.bc.googleusercontent.com. [35.238.199.243]) by smtp.gmail.com with ESMTPSA id h4sm869298ilr.58.2021.07.03.09.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Jul 2021 09:57:32 -0700 (PDT) Date: Sat, 3 Jul 2021 16:57:30 +0000 From: Dennis Zhou To: Guenter Roeck Cc: Tejun Heo , Christoph Lameter , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] percpu: flush tlb after pcpu_depopulate_chunk() Message-ID: References: <20210703051444.GA3786429@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.45 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 51D37B0000A7 X-Stat-Signature: 9mjyd9o4goeayyj9764j8sdr5pgfnebc X-HE-Tag: 1625331453-360943 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000032, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jul 03, 2021 at 05:25:02AM +0000, Dennis Zhou wrote: > On Fri, Jul 02, 2021 at 10:14:44PM -0700, Guenter Roeck wrote: > > On Sat, Jul 03, 2021 at 04:04:49AM +0000, Dennis Zhou wrote: > > > Prior to "percpu: implement partial chunk depopulation", > > > pcpu_depopulate_chunk() was called only on the destruction path. This > > > meant the virtual address range was on its way back to vmalloc which > > > will handle flushing the tlbs for us. > > > > > > However, now that we call pcpu_depopulate_chunk() during the active > > > lifecycle of a chunk, we need to flush the tlb as well otherwise we can > > > end up accessing the wrong page through an invalid tlb mapping. > > > > > > This was reported in [1]. > > > > > > [1] https://lore.kernel.org/lkml/20210702191140.GA3166599@roeck-us.net/ > > > > > > Fixes: f183324133ea ("percpu: implement partial chunk depopulation") > > > Reported-by: Guenter Roeck > > > Signed-off-by: Dennis Zhou > > > > Tested-by: Guenter Roeck > > > > Thanks! > > Guenter > > > > I updated the tag and have applied this to for-5.14-fixes so it can get > some for-next exposure before I send a fix to Linus. > > Thanks for setting up the super easy repro! It made debugging this > significantly easier. > I'm pulling this because I think I'll need to do some aggregation to make this less expensive. I'll send some variant soon hopefully. Thanks, Dennis