Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2479202pxv; Sat, 3 Jul 2021 09:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt8eD9jzpaN1axvuMt84yPhhTikTmi8jJTvf5TjZZWHyr7NRVAWZvCXJMX4hJYf0s2tP4P X-Received: by 2002:a05:6402:35cf:: with SMTP id z15mr6260721edc.208.1625331594223; Sat, 03 Jul 2021 09:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625331594; cv=none; d=google.com; s=arc-20160816; b=cbDXloAZVA9+pTzs9FpQdNtcdw1wCkjqPgvECT8LOq8x7HCP6vMOFd8+6iR4fbRjBN y6Rm4VSbSrADuAT8HT3G/nP20m01a4+VvAlqXPGLmhhAagF4MmJSQS6pHSFW7X8l6i97 XlCmjhWUPvQyPjLzQaovHoGHxKijKAA7v0sxwiWF+FVLSxa596iwCr+BvOuyKOcclJZn 4rQ0kHpH+QhqKnYIncae40nIyF97ZMtO0YX9KyWOmF85kjDDoORSgKqRMRUoCQtWeL+r jDDZMJ4eWTRs1U9NAfEED7GtnX0+0tsV+Vvz6nP9TA3Q4UHY4E7+yhvpUaVnHSNyLA5U wgug== 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=e6lHywLk8e8ZkMny6eUW/z6wvfFZ8vT2gzj9AFlMJnA=; b=qsomN+3k6xOCQjaEAco46XnCW+1r5x3yUWN2DJVMs/0Jjg6+UXoYpL9fg6NKLtO4R5 YBGthvumYeQnfxsjSbkF9oD9N3aJy7MJfDViNwb4LleuYtarAdyhE2WtMNHr4hev9bG3 cYYkReNiypmdOyPctIbuQB3cXq/CAMxouvQ2eBEQWKfm6a6GSNQK2zeCIDTFKCtWkzHY wqdhzN4r0ha4pZZnvr/zCRoJER5daJEqMR1PpZM28bmYCnsbeC8da3XvefxuUwH14c8o JnUBRlv3Mpmaye1tNW0iBOMukIZVl2oRJqwyVPwTR5sNADsMUJHZJ3bd93vrdOu/dJPf PcoQ== 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 g2si5790266edq.276.2021.07.03.09.59.30; Sat, 03 Jul 2021 09:59:54 -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 S229749AbhGCRAH (ORCPT + 99 others); Sat, 3 Jul 2021 13:00:07 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:39596 "EHLO mail-io1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbhGCRAG (ORCPT ); Sat, 3 Jul 2021 13:00:06 -0400 Received: by mail-io1-f52.google.com with SMTP id y76so15710977iof.6 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=H222JtpVNMXI1BRlO+A1X7neDDoXlNHYmzpYmRkGnaaLMQMase5t1qr1e8i4Kzwdvc YECNXBycHvNgj7gqwos4k8oJZhYgUbshQBpDGo+9hcZ71dtLGRQT2BJAl8NYglmg1ia6 //fL+DIqwnElg6wS8welLEDCRBJkDI53s2JjguLip6QHkiSpPEqYsWLnpnENFCTCByBT WQxRPcmuKxTS+Nh8HSnMmih7eE4rVRV0lkRImdvBqB8ujhzoVydytzhW9KD9wv62+2Na gPfCAj7sOFua3dZJuPu4cnLOd4MN929Fu58LRX0MnHBEzHMKaZMkk9/oKuIF1TQpy3mb 8cDQ== X-Gm-Message-State: AOAM532AKuhCi16Ca397wdL2NglNvG9veW6v9BOEWK+JMYCF5SA+6Yot EoWPl+rQuVQ9hWxsvtQaxn8= 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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