Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2096728pxv; Fri, 2 Jul 2021 22:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEZPb72/bIEEpw3I6xpyBaU5fnav8CK+JF68WQP+R4poyxOn0/vbFMRsx6htgxPMFGJhhx X-Received: by 2002:a05:6638:3398:: with SMTP id h24mr2462980jav.128.1625290008792; Fri, 02 Jul 2021 22:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625290008; cv=none; d=google.com; s=arc-20160816; b=VYtRdT5yoSy4sucMMi0SsCnK4nfU3crwlXe7brpHzQIvxX5plG9zD67v/6HWqBWdG4 ge2hTcP6N5W8sWj6hXDmBGERzbIvbUAx61bzMlI3Um6xJbhRX8avysF1UcGiAuSXUnik nut0MmOO94pUflxpOAUJsvcfM0f7xmYvLybcFN6JXMvkoYcYG+YYMqqwntS59A2pXSvJ l0hmdcEnt5z6hiLqlbRM/Gw1aOtfWxQd+2B14dMwEuqsFo7HdrPd8WGtcAVuNKpJYLjq ikxVByDnVfndp3b+qLMR9cK6a3MBsmHE+ofAvhhXsRPXvAiII85Fr3J5uF2ECzs9nCIU U66w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=c8Bfor1R4wpqJRsIH5H7C4467Vk3S/8t2GJe8QN9CtA=; b=j1Y49M6O1NFymHC8QfhMQ1oDW/zeyJDXd+1ckaMJ7XVyzSaK7UYdAZ0/EbxFl9ro1J TBfDAW6UR+5zdPbLdwMsjUHYOgF2BktBC0MWgHkg+5tkQVSAooSpFAbYiVwllyuVhOFx QV6RcorAxeH6laI551KfTjGWO5dg2HynlYaD2YN7l605hKf/7B3FFLnRmM/XghciR3s8 N/lZS/3hqdts8QBVcdAmYlnpSDL7pjRBgGY8srWf2ANg7gT0To6jSF775NFYyfgcAO4Z 8TwJSn5Nv6IZdknYNSZFSr97lQtM2Ec4ECXux9CnBF8VOXtHrQy6DIp2lR6JF/wq3+KC 87zg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w14si7288703iov.43.2021.07.02.22.26.36; Fri, 02 Jul 2021 22:26:48 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229557AbhGCF1j (ORCPT + 99 others); Sat, 3 Jul 2021 01:27:39 -0400 Received: from mail-io1-f44.google.com ([209.85.166.44]:45834 "EHLO mail-io1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhGCF1i (ORCPT ); Sat, 3 Jul 2021 01:27:38 -0400 Received: by mail-io1-f44.google.com with SMTP id g3so12255456iok.12 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=kVX5SWFvDrtfLrx4GtebQYFURyXaqhLIS4xjINPjkX0rbdoAfAxqkbOKKEyLsPVj9U tCUN4gJBnEFYpOcdkWKbFY8p1TEAPVXAkUjMwKV2Ev7PLXO0L9RscTVt9pPaswTaEzK3 w1zuliZMOcLGHe4LGmJgS/gjZT/fnpekQy+jygx/2cnia3X3WR/JuMHBAAuRFDL+Rphs vfSoB8/HimghdZcwB7CHVAAbqd1aibpTvvjMDZhchFOZMHdU7NgtVbaA2kSy+BGm+hoi BJCQWSPhAGt+Bf/NzFqw5ubcxQ+RYEFD0Z+B0gywj/Y6SMQiG1xwJGD7Z18ODJHlEDu2 5/TQ== X-Gm-Message-State: AOAM532kiqoQYgfnbmVe8mOZy/1iY0MgyFzV/sj0W9MwFA1DlOLrjgLg mzeD8cGU1t9jl/M6+ej1g5Px3qtBrLg= 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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