Message ID | 20190912002929.78873-3-yuzhao@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=iDsh=XH=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B703112B for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 12 Sep 2019 00:29:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 386282087E for <patchwork-linux-mm@patchwork.kernel.org>; Thu, 12 Sep 2019 00:29:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tp+vOykV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 386282087E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 433FA6B028C; Wed, 11 Sep 2019 20:29:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3E4426B028D; Wed, 11 Sep 2019 20:29:39 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23AFE6B028E; Wed, 11 Sep 2019 20:29:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id EE8526B028C for <linux-mm@kvack.org>; Wed, 11 Sep 2019 20:29:38 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 5765F181AC9B4 for <linux-mm@kvack.org>; Thu, 12 Sep 2019 00:29:38 +0000 (UTC) X-FDA: 75924385236.27.chair86_19e5d01cbf229 X-Spam-Summary: 2,0,0,9ea72b682a5ce293,d41d8cd98f00b204,3czf5xqykcgwiejrkyqyyqvo.mywvsxeh-wwufkmu.ybq@flex--yuzhao.bounces.google.com,:cl@linux.com:penberg@kernel.org:rientjes@google.com:iamjoonsoo.kim@lge.com:akpm@linux-foundation.org:kirill@shutemov.name:penguin-kernel@i-love.sakura.ne.jp::linux-kernel@vger.kernel.org:yuzhao@google.com,RULES_HIT:41:152:355:379:541:800:960:966:973:988:989:1260:1277:1313:1314:1345:1359:1437:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:3138:3139:3140:3141:3142:3152:3352:3865:3866:3867:3870:4385:5007:6261:6653:9010:9012:9969:10004:10400:11026:11658:11914:12048:12296:12297:12533:12555:12895:13069:13311:13357:14096:14097:14181:14394:14659:14721:21080:21444:21627:30054,0,RBL:209.85.222.201:@flex--yuzhao.bounces.google.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:non e X-HE-Tag: chair86_19e5d01cbf229 X-Filterd-Recvd-Size: 3737 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) by imf23.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Thu, 12 Sep 2019 00:29:37 +0000 (UTC) Received: by mail-qk1-f201.google.com with SMTP id u17so15317055qkj.7 for <linux-mm@kvack.org>; Wed, 11 Sep 2019 17:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=aQObBnsoF37hTK58s3QRsq2XDnpF8nVsAPwHxvDTqp4=; b=tp+vOykVFb6wUsjvQv2rrq40mey4jC2MVuUOo62FVit7XzEuaaCrt0Aliep49jaMiY XbUwG8uuq24QHYFR1pJXCGLPlk8YErtCXtbkDMHqwebZu9qAnRnSI/g0XfTBOt0PWM5z +I1bY29tI3TZKsWz3SvhpAV9F6AiGL9n/hfy/Px34sAcEY7+oQGL2CAHQLWdf+tIglJe W3yG6rm1gP6NFBf3dIxi5GmhqJaznQb/QPwy8hRpuMgN4CeDrRfdsP0q/N+e/Gt9Y2Hh YepnosVfNG9Kn5Z5M9n1US8q6U8NgabAvnJug85mkUCVYj4mLlaILu8iJr55zzhPg34s hzIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=aQObBnsoF37hTK58s3QRsq2XDnpF8nVsAPwHxvDTqp4=; b=sQu9bJ0SM83Sq+MhnFUOB21Ax0tvPNb9Ni1Ub1xsu8Yq6J6pIw/De1qZGIXchteF/b goJKWfGMlk8YIuKL3+q/C5SZFcE51H/W9HkxKSyLeKJnVt889LyFr8qWhGWJz7gXqTZ3 Xx98YxSoxYGs3fF5dnCIA0Qbvgio9hXH1gSKRunhD3fvDkeOx72KgLatSe1eJSqvE2GP 2wZilM8AJvw5Qn+pZ4D2BT4//peGpRA3an7zBdJa51aFXovo+RSVmthj0UPWh/7wsfBa vNWNgrTrHd+3Rktac5GjmKsPzYs1UEdvy05VM9YpR9OYDMHO4+3xnmg9jZnkOTWqC6C2 tOvw== X-Gm-Message-State: APjAAAVu87VtBwmHAwmV+imBZTgFe6LrpOV+cNcrHTimEcEEol2INLyv +xsnf1zBdWKOE0uJndeSviSZuxmC9Ew= X-Google-Smtp-Source: APXvYqzK80GPgtRHqvxLYSknsuTpGxTEnT/qyaOOSlta3kEOoLG8zvl4/XdyIzaKcqVWNpZnMQh96oPAaU8= X-Received: by 2002:ac8:678f:: with SMTP id b15mr37229590qtp.293.1568248177173; Wed, 11 Sep 2019 17:29:37 -0700 (PDT) Date: Wed, 11 Sep 2019 18:29:29 -0600 In-Reply-To: <20190912002929.78873-1-yuzhao@google.com> Message-Id: <20190912002929.78873-3-yuzhao@google.com> Mime-Version: 1.0 References: <20190911071331.770ecddff6a085330bf2b5f2@linux-foundation.org> <20190912002929.78873-1-yuzhao@google.com> X-Mailer: git-send-email 2.23.0.162.g0b9fbb3734-goog Subject: [PATCH 3/3] mm: lock slub page when listing objects From: Yu Zhao <yuzhao@google.com> To: Christoph Lameter <cl@linux.com>, Pekka Enberg <penberg@kernel.org>, David Rientjes <rientjes@google.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Andrew Morton <akpm@linux-foundation.org>, "Kirill A . Shutemov" <kirill@shutemov.name>, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yu Zhao <yuzhao@google.com> Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[1/3] mm: correct mask size for slub page->objects
|
expand
|
diff --git a/mm/slub.c b/mm/slub.c index f28072c9f2ce..2734a092bbff 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4594,10 +4594,14 @@ static void process_slab(struct loc_track *t, struct kmem_cache *s, void *addr = page_address(page); void *p; + slab_lock(page); + get_map(s, page, map); for_each_object(p, s, addr, page->objects) if (!test_bit(slab_index(p, s, addr), map)) add_location(t, s, get_track(s, p, alloc)); + + slab_unlock(page); } static int list_locations(struct kmem_cache *s, char *buf,
Though I have no idea what the side effect of a race would be, apparently we want to prevent the free list from being changed while debugging objects in general. Signed-off-by: Yu Zhao <yuzhao@google.com> --- mm/slub.c | 4 ++++ 1 file changed, 4 insertions(+)