Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp772334imm; Wed, 8 Aug 2018 05:37:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz1mPoRQTpBMvQBa+b0ZWzMuPtUnpdF35f4p1bYkRORye3Z4xk6O6kG3RS61aUaQOpC2amb X-Received: by 2002:a63:8f03:: with SMTP id n3-v6mr2411374pgd.166.1533731868107; Wed, 08 Aug 2018 05:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533731868; cv=none; d=google.com; s=arc-20160816; b=J/oBksy7itNIn4JBw6ccYtZNPgkUY0f3wzRWUhFxVr+8hLqVmKVRQ555MBvS5Soxcx OC3enaV0YMDHwNNYblZkzGNqse3+hIBI4XVRaRNz29oS76wY8Elo42Wq9qlpPVEu0EYC rB5bRgvKRjip4ubZYGPT/hj8yDm3Gha0t1OqfqCRM+5Rk65Dpg9W+4pebzxAiPD1vMNH QM6EtAskrL15dsv5QgrNKIJmZB3rBnwvPE98+XhjOdYdsAc5dChRgv0PmrDXW7o+UshW ZzHQN6z7NTI+c3bL2aZ0X/L5dFRdXXr4qZkbCqE2iSjpr+vG5Tt5c0/RGQvhS8zuJWIe WZuQ== 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:cc:references:to:subject:arc-authentication-results; bh=IMIFMoNIruPbllMUommhdKrCsEWaZu8PYk/3lwup63w=; b=YFSeltiyD1XdDv1wvCq4YM99MnCCEkhcBB4G2JMCHxmSXTPamTujAaoGxGf3YpdbV4 B/i9J9Cd8AEiUUjp6lJQmrkNu3LMIkgrS5HATXcbmFT1a5DnOmhW14Juw4LNTZCe24DY 3OD34HqRqZmkJJlfsLsaMdrBFL5R1Sn0HL6hrR12inigIuYlviSp2WtFXnFjlVglO8CK nlMKLJkA7Ap52Npd1Vlj7MMF1w//p0ZczP4ZutavO8ccTd6iEbjjkdsyrp8wk563nyVL IXG2dTBekxUWIP25JukQri9905gsPSBzsyEFkXb5drvAvpyYlBbHFVwrWeKDU7jXTBPN kRng== 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 g13-v6si3171854plo.153.2018.08.08.05.37.29; Wed, 08 Aug 2018 05:37:48 -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 S1727035AbeHHO4C (ORCPT + 99 others); Wed, 8 Aug 2018 10:56:02 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:55927 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726733AbeHHO4B (ORCPT ); Wed, 8 Aug 2018 10:56:01 -0400 Received: from fsav303.sakura.ne.jp (fsav303.sakura.ne.jp [153.120.85.134]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w78CaN8k030668; Wed, 8 Aug 2018 21:36:23 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav303.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav303.sakura.ne.jp); Wed, 08 Aug 2018 21:36:23 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav303.sakura.ne.jp) Received: from [192.168.1.8] (softbank126074194044.bbtec.net [126.74.194.44]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w78CaJr4030649 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Aug 2018 21:36:22 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH RFC 02/10] mm: Make shrink_slab() lockless To: Kirill Tkhai References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> <153365626605.19074.16202958374930777592.stgit@localhost.localdomain> <591d2063-0511-103d-bef6-dd35f55afe32@virtuozzo.com> Cc: mhocko@suse.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Tetsuo Handa Message-ID: Date: Wed, 8 Aug 2018 21:36:18 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <591d2063-0511-103d-bef6-dd35f55afe32@virtuozzo.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 2018/08/08 20:51, Kirill Tkhai wrote: > @@ -192,7 +193,6 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker) > int id, ret = -ENOMEM; > > down_write(&shrinker_rwsem); > - /* This may call shrinker, so it must use down_read_trylock() */ > id = idr_alloc(&shrinker_idr, SHRINKER_REGISTERING, 0, 0, GFP_KERNEL); > if (id < 0) > goto unlock; I don't know why perf reports down_read_trylock(&shrinker_rwsem). But above code is already bad. GFP_KERNEL allocation involves shrinkers and the OOM killer would be invoked because shrinkers are defunctional due to this down_write(&shrinker_rwsem). Please avoid blocking memory allocation with shrinker_rwsem held.