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=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 67DEDC433E0 for ; Fri, 5 Jun 2020 21:07:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2130120772 for ; Fri, 5 Jun 2020 21:07:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FjJJwJCc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2130120772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C4531280004; Fri, 5 Jun 2020 17:07:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCEB88E0006; Fri, 5 Jun 2020 17:07:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABD6E280004; Fri, 5 Jun 2020 17:07:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id 93F558E0006 for ; Fri, 5 Jun 2020 17:07:30 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4B40C8248D51 for ; Fri, 5 Jun 2020 21:07:30 +0000 (UTC) X-FDA: 76896394260.05.heart79_57031db26da3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 26C8F1801FFE3 for ; Fri, 5 Jun 2020 21:07:30 +0000 (UTC) X-HE-Tag: heart79_57031db26da3 X-Filterd-Recvd-Size: 3800 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 5 Jun 2020 21:07:29 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id q16so4192125plr.2 for ; Fri, 05 Jun 2020 14:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=LAKOPXbe4RPyKHwWm8SyOT1HEgYJl1gtZcKOt6lUg6c=; b=FjJJwJCcf9AvvSyyshowMJu/voV+MLp0TA3WCFDzlRbz7EjF1WrlqA+c4PDQTjbA5b brD8n1tfCs4jieTe0se2Q4IciRQUKhmKKrzlbDGyZhO/VvGMHb1tRrqGRtg8I/Sm5Gex pwrQhBd4qfmx9o2usDhyuWrosKBbMETOBq3v8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LAKOPXbe4RPyKHwWm8SyOT1HEgYJl1gtZcKOt6lUg6c=; b=Lc3XGY6VnMVtKfy6b/U1zj1xtNOb9xTcP7rf/t3sHEjEj7ilqaDoh+GYlmkep8lkM9 kns2lBILRrjZfZkbPckOVXafmoRNxsGZsZveKwTaZ3/BdB41sY1CD5B4wU0RqFQJISIL ylL9d7GNp56qkPNAzEVpTk5BugpytZO5pz7ebSbhGqYE1agRVSZtEOUu9g05aIStc8dj Elz4XGQSJXA9sgvYIxsUrLxDTzzZw7zppnpbU4k/i/WoyEbck6hWhqKAMyw3lq8/x3cA ymqXQW/c+lvV06QIlSFklPQ3vyRtyzJDBTUh2d5xuenWxomVJDjWmy4fYU8Bhklnf0Pa 8I8A== X-Gm-Message-State: AOAM532O82qm97H2lGUwRGAfA3D26XImeohrm/5jFsBi+akbtOGZRSGZ vu/8bAw85NurufXYRLwl+HnJ8w== X-Google-Smtp-Source: ABdhPJynPweyb9yyxMtn15+LBtzfHV7x58u9sRCi1LH2+vF1aXgbJMfpp86VUeLqomjGYKh/hm6pIg== X-Received: by 2002:a17:90a:db90:: with SMTP id h16mr5145656pjv.119.1591391248908; Fri, 05 Jun 2020 14:07:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u7sm450764pfu.162.2020.06.05.14.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 14:07:27 -0700 (PDT) Date: Fri, 5 Jun 2020 14:07:26 -0700 From: Kees Cook To: Vlastimil Babka Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@android.com, vinmenon@codeaurora.org, Matthew Garrett , Jann Horn , Vijayanand Jitta Subject: Re: [RFC PATCH 5/5] mm, slub: make reclaim_account attribute read-only Message-ID: <202006051407.2B00B067@keescook> References: <20200602141519.7099-1-vbabka@suse.cz> <20200602141519.7099-6-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200602141519.7099-6-vbabka@suse.cz> X-Rspamd-Queue-Id: 26C8F1801FFE3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On Tue, Jun 02, 2020 at 04:15:19PM +0200, Vlastimil Babka wrote: > The attribute reflects the SLAB_RECLAIM_ACCOUNT cache flag. It's not clear why > this attribute was writable in the first place, as it's tied to how the cache > is used by its creator, it's not a user tunable. Furthermore: > > - it affects slab merging, but that's not being checked while toggled > - if affects whether __GFP_RECLAIMABLE flag is used to allocate page, but > the runtime toggle doesn't update allocflags > - it affects cache_vmstat_idx() so runtime toggle might lead to incosistency > of NR_SLAB_RECLAIMABLE and NR_SLAB_UNRECLAIMABLE > > Thus make it read-only. > > Signed-off-by: Vlastimil Babka Reviewed-by: Kees Cook -- Kees Cook