From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 713CDC4361B for ; Fri, 11 Dec 2020 01:17:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B20C622E01 for ; Fri, 11 Dec 2020 01:17:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B20C622E01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D706C6B0036; Thu, 10 Dec 2020 20:17:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D21B66B005D; Thu, 10 Dec 2020 20:17:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE8926B0068; Thu, 10 Dec 2020 20:17:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id A5DA26B0036 for ; Thu, 10 Dec 2020 20:17:17 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 37E298249980 for ; Fri, 11 Dec 2020 01:17:17 +0000 (UTC) X-FDA: 77579238114.28.air65_2100058273fc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 16E7E6D72 for ; Fri, 11 Dec 2020 01:17:17 +0000 (UTC) X-HE-Tag: air65_2100058273fc X-Filterd-Recvd-Size: 3941 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Dec 2020 01:17:16 +0000 (UTC) Received: by mail-qt1-f175.google.com with SMTP id f14so5336469qto.12 for ; Thu, 10 Dec 2020 17:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=2n25eVeYwJwJEQSpBnUbsA/VYusbzI2FjI83kAbMkUM=; b=OoidibmzJM8FY+fLVy5oGNIhE+hZQvybpZraGbmZGbLTYsX+lK5IBoySlrDDMdzTXV XJjICjohp12ZWQt4DbTgStQYqNYDpL5qpthTob4AT1pFXGgdalG8qBXSD9hV9923BspI Qmm4cct6as6nyyQD5gBjGXRTQEGsDS+a0bsmTOV/52EcbgooOETiSvoaJkdL2bklur+y 2755FgXlRXBMnioLw+WVy/h/vC8XeWZzj6ng9+5GHh+wKAMu5oCVlSgNCK0AMFhs4Cs0 OfkKejJ7/EQJuum+nIU5MjSwUOaCxf+9nCtD+O+wx+yHXBN9piQ26swMloQgPpVLevcV dmiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=2n25eVeYwJwJEQSpBnUbsA/VYusbzI2FjI83kAbMkUM=; b=EFRsMOAYylK6MxdJvzx3/5MoOxbpsYXo3voCTCH3L2iQLY5V7XvloeWxDPHPwARV6F 2HeASt9qFPIEWZjBWDcDhZweh7AMg3IMQpFfGDDg7f+LFhYs9zyZxGPHIDOdSG1x+Yl0 l3S69uN9C4YlhH+3Wqy6MAQ7GyTMDNkV3cq58GvZY0ZR8DbSmjJAyJYnP81GiUOZYqEx n1mOSaxXKlkuo2XUynTW0FghV4zUSHfL6qimVSstDP6033zSIHfOb0QSFoLtjENkntL2 1iU6U9BnMJ8MgseU6AHOL8m3aaZZ8BnEsJe0c/9QPSVY3QSWNZwgvOWK2v4IJwPBg3lE 0DIQ== X-Gm-Message-State: AOAM531YLen78xT5Gehq/zdwMpHoeb+0i8cd/oAVNNXIRWERRvGg1xeb NmaqdL+ccWYtbKtX6lOG2MM8NOXGAK+ux6iUU4Y= X-Google-Smtp-Source: ABdhPJwKxmvuVC716F8eCTuGBPdQQHJBDcAFCAVQxZMSphn8ehOHVaQEpEZFFtr33WIPaT39hFpJAoHX5vS2OS1yHtk= X-Received: by 2002:ac8:6e81:: with SMTP id c1mr12501578qtv.36.1607649436049; Thu, 10 Dec 2020 17:17:16 -0800 (PST) MIME-Version: 1.0 References: <20201210160020.21562-1-vbabka@suse.cz> In-Reply-To: <20201210160020.21562-1-vbabka@suse.cz> From: Joonsoo Kim Date: Fri, 11 Dec 2020 10:17:05 +0900 Message-ID: Subject: Re: [PATCH] mm, slab, slub: clear the slab_cache field when freeing page To: Vlastimil Babka Cc: Andrew Morton , Linux Memory Management List , LKML , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 2020=EB=85=84 12=EC=9B=94 11=EC=9D=BC (=EA=B8=88) =EC=98=A4=EC=A0=84 1:00, = Vlastimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > The page allocator expects that page->mapping is NULL for a page being fr= eed. > SLAB and SLUB use the slab_cache field which is in union with mapping, bu= t > before freeing the page, the field is referenced with the "mapping" name = when > set to NULL. > > It's IMHO more correct (albeit functionally the same) to use the slab_cac= he > name as that's the field we use in SL*B, and document why we clear it in = a > comment (we don't clear fields such as s_mem or freelist, as page allocat= or > doesn't care about those). While using the 'mapping' name would automagic= ally > keep the code correct if the unions in struct page changed, such changes = should > be done consciously and needed changes evaluated - the comment should hel= p with > that. > > Signed-off-by: Vlastimil Babka Acked-by: Joonsoo Kim