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 C0676C07E97 for ; Sat, 3 Jul 2021 05:25:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5CD37613FE for ; Sat, 3 Jul 2021 05:25:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CD37613FE 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 D8F266B0011; Sat, 3 Jul 2021 01:25:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3F8D6B0036; Sat, 3 Jul 2021 01:25:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE04B6B005D; Sat, 3 Jul 2021 01:25:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 9C78A6B0011 for ; Sat, 3 Jul 2021 01:25:05 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2F5C38248047 for ; Sat, 3 Jul 2021 05:25:05 +0000 (UTC) X-FDA: 78320137770.14.AD45E66 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by imf07.hostedemail.com (Postfix) with ESMTP id DFE6D10004FC for ; Sat, 3 Jul 2021 05:25:04 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id d9so14201700ioo.2 for ; Fri, 02 Jul 2021 22:25:04 -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=c8Bfor1R4wpqJRsIH5H7C4467Vk3S/8t2GJe8QN9CtA=; b=UuWTzaVf6r5q1gV2M9XTEZvs+o/TF+531Pv3nfKIh3HgK75flVvKatcW/rwpx18DMy cXYIQ1VUCNZjsl5fLPl20ep3ijCelF18/0MoFoq/YVxuJdGYmpRWUL9Vd4aySqRvHp+O pAZCzgwLgMRTJIphzHZ+fhEIB/Z4X2FWZeAd74sumYvqvYe4ImO33xn2TvLv6/CjlDlV R5z19zSI77hKcVEsDIqRQIeygfeFH/v7WyuB2dDlO7e+MWN0BGnEPfZ1YC60XzCsmr5G 4rAnp6RJAu9Iq4KkcITM9xps8gU0mGFT3EsxihLAUqxhGQvSkb8GBE/j2vgWsR4iIMrF sTAA== X-Gm-Message-State: AOAM531zcUTCJZ6VJUmiKjcG1/FRCxy/x4yljwZypHhas/pOljeqX5RJ ZJ3VZwIBxjUNH1nc32rkD1w= X-Google-Smtp-Source: ABdhPJzkE2mghXDvSfvuweq8J+Fj16WCb2OQWQoMswgNv+d+xZvwqnTjcwW6GHFZKlgnnBZOHMItLg== X-Received: by 2002:a05:6638:9a:: with SMTP id v26mr2460687jao.124.1625289904256; Fri, 02 Jul 2021 22:25:04 -0700 (PDT) Received: from google.com (243.199.238.35.bc.googleusercontent.com. [35.238.199.243]) by smtp.gmail.com with ESMTPSA id r6sm2971487ioh.27.2021.07.02.22.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 22:25:03 -0700 (PDT) Date: Sat, 3 Jul 2021 05:25:02 +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: <20210703051444.GA3786429@roeck-us.net> Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of dennisszhou@gmail.com designates 209.85.166.41 as permitted sender) smtp.mailfrom=dennisszhou@gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: 8ojum8s5mgx87hhk7dqtt1ujw9fx4g7d X-Rspamd-Queue-Id: DFE6D10004FC X-HE-Tag: 1625289904-607749 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 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. Thanks, Dennis