Received: by 10.213.65.68 with SMTP id h4csp4320572imn; Tue, 10 Apr 2018 12:56:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48vZx7GLK059F5T68d20jWZh3P24i/o6c14pRAB9wAA4y7FkvbnLzaWJZWHdCS1lWjzZqeN X-Received: by 10.98.210.7 with SMTP id c7mr1469529pfg.92.1523390216741; Tue, 10 Apr 2018 12:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523390216; cv=none; d=google.com; s=arc-20160816; b=vknECRHUYVhsz4AEAoDFZ/9+k0ZWQiB3NMqIZXJh8CUEqzXveThxh8BgvrWVoQqCoy ByXkY/kGJX/D8vL8vsfSo6Js6xwn0YvTGqOvozeErDKUJZ6uc/Y9wD4KRt5+6OmBeZDS PWGGp/15p8f8tUncDHnSkqRMODqNPOwuYpGY/K5SN8UcFxU7YpCjn0pdaQ0bUHaOBzYL LlKYHuKR7ZVxz8oah5Ic10J/npOnUTRzScQimp83vMaYvcijJzkw6Lwizr8JzcXjJFeW kYRPoMs+NPZ37Bnf3NLYgyYRtr68ms7z7E0lOXNX3ALyJCt3Qv1gJZD565Pm1aYj9HPg Fdvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=V+J/V5ruhRsc2fF3o7JaPUWdMvgj/8e9XE0uSZMIo5c=; b=SXhREKxD9YKOBPwaOd0S0XhdDC9yXLFZtkedQVysjrmj+Pk9mxlLAtMnW7bKZZeCvq 1KqtMKrmtImjqe0oMvFE+PeF/XGxp7vVm0JpGNb7OevQMislfk/dgmOdnqTVBvSA42Wa GknuqWaRbwhpZt8bbxCuUtc12Gk7ep6pZQgedkfEvJNgrFA3w/GxxYTr02y2BoB/X+xy zpgB1aOwZv3nMN5ItNvTMkoQoZ4tx8ske3oS301ov1evuHzJlCtsg/4V7xOurRrSFIH9 LcBKxW+HOa0fX+uW7SamDqYXFJNDyW6SNG52jShf8aGCD+1fUlNYXKtjb2bZ3BZCNGpt JE1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rclIBK4u; 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 1si2624529pfq.172.2018.04.10.12.56.10; Tue, 10 Apr 2018 12:56:56 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rclIBK4u; 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 S1753233AbeDJTxJ (ORCPT + 99 others); Tue, 10 Apr 2018 15:53:09 -0400 Received: from mail-yb0-f179.google.com ([209.85.213.179]:38884 "EHLO mail-yb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbeDJTxI (ORCPT ); Tue, 10 Apr 2018 15:53:08 -0400 Received: by mail-yb0-f179.google.com with SMTP id k1-v6so4744722yba.5 for ; Tue, 10 Apr 2018 12:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=V+J/V5ruhRsc2fF3o7JaPUWdMvgj/8e9XE0uSZMIo5c=; b=rclIBK4uuDNZujNPG5LV0NVFUwReej1xQYaXpl6l/VEokKg0L0tzmIRgJqWgBw9kDJ PmqSPeSkyKxnZid8bF5l1aeThlLb49qNjRpbft7KZG4cOCvBrgghyyd0kv88xJ5S+o3s KlazVdNwup6rx0gyawn/FmNzXu2E7KvKYQmzQ90u/ZCaLFrz/0nl7uCneJRPMbzs5BpS IEn7aaYPPwBjVgkAbIoPOzFmFD7l3MWvRwp9PEpDx0MAM8B8XHNuLo4g5QmQ/eyHovLy dNBsEipsDP5360RPkIu8Cfs+B1Nl6rR9+P9poEQfkkqk/l5BwuIWwb24jL8sfhFwmvp7 PTkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=V+J/V5ruhRsc2fF3o7JaPUWdMvgj/8e9XE0uSZMIo5c=; b=LMw+1/9fXNhvZLZE9jYH8UHWiXao9TptT1kG+hA3XZbEO7uj6ZAJWcTI3DMawJv7bj FihLlQNb4vYv03XSJQoQB8INLmvI6wUp1Coc+ruT/XnBW6+rGLfFpVErC7CdW7lfKsj5 xWZdq1zbYparLoPHqev0f3hHM8TPzlP/pryStHafC1/4Xh7wQRv1vkAcRsrUvw/g4vLj elsHI+fdbs9bAeilBxR4CAWEmuzEinkaWmZkp97vL/qbWhl47sNZkBvj/Xt3lpm7dk6C spPbvYCKzU8912pBu9+MiIV/fKUhOB44heNct5OCHHsGBi0EPg8cT1DByiN/MC8kcne3 lW1Q== X-Gm-Message-State: ALQs6tCU0Zo5Raw5iiRzneIy9UvpC59+EZDpa80IoPhDr44bsWImmOhV XqNX/JYchIDKrtL7+qDI4+Z2k3HU X-Received: by 2002:a5b:64d:: with SMTP id o13-v6mr1130168ybq.519.1523389987568; Tue, 10 Apr 2018 12:53:07 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::1:f676]) by smtp.gmail.com with ESMTPSA id t126sm1512936ywg.40.2018.04.10.12.53.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 12:53:06 -0700 (PDT) Date: Tue, 10 Apr 2018 12:53:05 -0700 From: Tejun Heo To: Vlastimil Babka 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 Subject: Re: [RFC] mm, slab: reschedule cache_reap() on the same CPU Message-ID: <20180410195247.GQ3126663@devbig577.frc2.facebook.com> References: <20180410081531.18053-1-vbabka@suse.cz> <983c61d1-1444-db1f-65c1-3b519ac4d57b@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <983c61d1-1444-db1f-65c1-3b519ac4d57b@suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. > > 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. Thanks. -- tejun