Received: by 10.213.65.68 with SMTP id h4csp4343079imn; Tue, 10 Apr 2018 13:20:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+aGqTsIHwDI11dNlBBR3MvSmptnI4fB9DfvJZ83ONKAmCD7QAPr0P67pcqWoWYRvx/VEem X-Received: by 10.99.146.83 with SMTP id s19mr1336557pgn.104.1523391616677; Tue, 10 Apr 2018 13:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523391616; cv=none; d=google.com; s=arc-20160816; b=VKKGJi+HSrj06jCun3AsquYU064DGOAaySUXJVNHSHGR9jiywQrTsdy1ERT7LiEpoh hsr/KLJUjy1HktuincpGmYNf4qk0NhWXwHdW42MyjiW6rXrnF7J66y3cKlugfpFdXrQG X3bBRji+0/Rt1+g0j/f6BMKUaloWkYDIJrm+kD6l7LO1oMF8+o/hUY6wm5kbNTrdNRow WRBIEJAWwEC+8dGzh2m2MHDEyVIJ2MGO2/r2lGPfSZHP+dJvfEj1VXsm4Ecz+jA6aBr4 Gx+5VTFvsp7Im028jvw+l5m8vPD160zn24yhtSXloM59xe5fXkTWKogT11aRPCoZ0F8T +m+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=AQC+2c4nv3SuB7qexUWuC/FCd2pR5xAlXJ2fg2yOdws=; b=KEoxvkMHV7Fny59HkIgO6wwCXE0Q1XDxGFNaskUzZ24HF0FSQVuPd2yYpXJMdJXSti GPooMpvsF2ipYT2K1j+vqSEKfuMjdSzz/yFGsYiSZ3wKkFOmzrM0Xor6AvwfJpyi3eLE 9mPxiaquFxO5v5iJv1+5KW3thTF0r/71GO8AARxjBtupgsrw8yUMVlq3RlRsL/YQJQL3 fHWhVJoJTwkLBsBTGdbAtYmLnGB4UKYLt/uOA25xdIUc+oAXLTMBK+MFvsNfqQuQX/xC 7C+z7m7kVoFAgt1m3qlI1frOm3m572RipB9dcvABSIeM4M8Qv2gS3ua13qDLyhR8w2+Z +mMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si3238851plb.114.2018.04.10.13.19.37; Tue, 10 Apr 2018 13:20:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753227AbeDJUPc (ORCPT + 99 others); Tue, 10 Apr 2018 16:15:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:54793 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbeDJUPb (ORCPT ); Tue, 10 Apr 2018 16:15:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D22A5AE55; Tue, 10 Apr 2018 20:15:29 +0000 (UTC) Subject: Re: [RFC] mm, slab: reschedule cache_reap() on the same CPU To: Tejun Heo Cc: Christopher Lameter , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim , David Rientjes , Pekka Enberg , Lai Jiangshan , John Stultz , Thomas Gleixner , Stephen Boyd References: <20180410081531.18053-1-vbabka@suse.cz> <983c61d1-1444-db1f-65c1-3b519ac4d57b@suse.cz> <20180410195247.GQ3126663@devbig577.frc2.facebook.com> From: Vlastimil Babka Message-ID: Date: Tue, 10 Apr 2018 22:13:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180410195247.GQ3126663@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2018 09:53 PM, Tejun Heo wrote: > Hello, > > On Tue, Apr 10, 2018 at 09:40:19PM +0200, Vlastimil Babka wrote: >> On 04/10/2018 04:12 PM, Christopher Lameter wrote: >>> On Tue, 10 Apr 2018, Vlastimil Babka wrote: >>> >>>> cache_reap() is initially scheduled in start_cpu_timer() via >>>> schedule_delayed_work_on(). But then the next iterations are scheduled via >>>> schedule_delayed_work(), thus using WORK_CPU_UNBOUND. >>> >>> That is a bug.. cache_reap must run on the same cpu since it deals with >>> the per cpu queues of the current cpu. Scheduled_delayed_work() used to >>> guarantee running on teh same cpu. >> >> Did it? When did it stop? (which stable kernels should we backport to?) > > It goes back to v4.5 - ef557180447f ("workqueue: schedule > WORK_CPU_UNBOUND work on wq_unbound_cpumask CPUs") which made > WQ_CPU_UNBOUND on percpu workqueues honor wq_unbound_cpusmask so that > cpu isolation works better. Unless the force_rr option or > unbound_cpumask is set, it still follows local cpu. I see, thanks. >> So is my assumption correct that without specifying a CPU, the next work >> might be processed on a different cpu than the current one, *and also* >> be executed with a kthread/u* that can migrate to another cpu *in the >> middle of the work*? Tejun? > > For percpu work items, they'll keep executing on the same cpu it > started on unless the cpu goes down while executing. Right, but before this patch, with just schedule_delayed_work() i.e. non-percpu? If such work can migrate in the middle, the slab bug is potentially much more serious. >>> schedule_delayed_work_on(smp_processor_id(), work, round_jiffies_relative(REAPTIMEOUT_AC)); >>> >>> instead all of the other changes? >> >> If we can rely on that 100%, sure. > > Yeah, you can. Great, thanks. > Thanks. >