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=-12.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 963C2C04EBE for ; Fri, 16 Oct 2020 02:40:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0EB2720897 for ; Fri, 16 Oct 2020 02:40:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="UzPVodG7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EB2720897 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 C264994000D; Thu, 15 Oct 2020 22:40:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD5FD900002; Thu, 15 Oct 2020 22:40:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A288B94000D; Thu, 15 Oct 2020 22:40:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 750CB900002 for ; Thu, 15 Oct 2020 22:40:44 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 0FE3A1EE6 for ; Fri, 16 Oct 2020 02:40:44 +0000 (UTC) X-FDA: 77376235608.06.grain72_030470127219 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id E4B0B10247F4E for ; Fri, 16 Oct 2020 02:40:43 +0000 (UTC) X-HE-Tag: grain72_030470127219 X-Filterd-Recvd-Size: 4716 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Fri, 16 Oct 2020 02:40:43 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id f21so946041wml.3 for ; Thu, 15 Oct 2020 19:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MM4vknTStYRLkGZw4tEHhTyBDfVUaCowXRmIC2TIp+c=; b=UzPVodG7vA2ic1HH1rFJ9ZFcjIcafLiynej1hsfsW7Kk8wfH5gNDzFpgzEjh3lN58l k0dAp9bXU+cG3pzw3tHSGbuYEk2L7mtIYHUFm+JeveAYlOMp75+XCbhV8IOZtonrBENQ N3EuUEXsABr3wvBaELeeMCVuFKi/re3WS+eoQMSP1pOGXHnkEyafFQENqCfVkz8ZBh12 LEr/np5tTIRUXaDrf3a6Zu5AOPiFCvfr+ogI139Xbc2dsROxhWd1zDR87GC3eWDxiU15 Mgm+yz3mfYc2ggE+SKeJcFy7gWvizCM5fduQMpvrjIhdvXokKcUaTd0xrhi19exO0wq1 CZQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MM4vknTStYRLkGZw4tEHhTyBDfVUaCowXRmIC2TIp+c=; b=UTNXdPAUEPBDFJUm0M+A4cRO2oW9WV1YS96iHzt+ggU6p5ONS59f2smdrRIlOCgHrY tbITnFQSb8Ew30VqzOipU6LimFSrGUzZiBJQFpRsgQhzYMf1QjmcW5qKD900es5848BD HQVBkMhD84POpULfRFGu3Avf8olI3UAoWXgbIvWh/DJ9F0n2+bTNBk56tpKS6dGbnUUj G7CB7hBVRCoXvvs9l49v9K4sleedO1ieXfMYabOjlG1uvp2zRuuHuMoDa14iRPB/CdnF CxcQhPCTaMfozX/x9sApaUU7CgN1ZaQg8q3+4DrqJQBNZ41R5LlOzVAvHGvWNl0yusMn to5w== X-Gm-Message-State: AOAM532azoKWyqE3vvHXAos5bqAvbCUmUvobNYowKEOrH53M/eUNKqw7 S+5NWJzEKovuin/tnhmSdfIsAbUn/epB/A== X-Google-Smtp-Source: ABdhPJzhEFMFksHr3z4YKmc2OKnKI/GGyeg8SX7OdlCeHKjZMM8NAVXhzJhEFVJQFXw7prbPniY0DA== X-Received: by 2002:a7b:c451:: with SMTP id l17mr1421587wmi.127.1602816042197; Thu, 15 Oct 2020 19:40:42 -0700 (PDT) Received: from localhost ([2a02:168:96c5:1:55ed:514f:6ad7:5bcc]) by smtp.gmail.com with ESMTPSA id p9sm990595wma.12.2020.10.15.19.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 19:40:41 -0700 (PDT) From: Jann Horn To: Andrew Morton , linux-mm@kvack.org, Eric Biederman , Oleg Nesterov Cc: linux-kernel@vger.kernel.org, Will Deacon , Kees Cook , Ingo Molnar Subject: [RFC PATCH 6/6] mm: remove now-unused mmdrop_async() Date: Fri, 16 Oct 2020 04:40:19 +0200 Message-Id: <20201016024019.1882062-7-jannh@google.com> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201016024019.1882062-1-jannh@google.com> References: <20201016024019.1882062-1-jannh@google.com> MIME-Version: 1.0 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: The preceding patches have removed all users of mmdrop_async(); get rid o= f it. Note that on MMU, we still need async_put_work because mmput_async() uses it, which in turn is used by binder's shrinker callback. We could claw ba= ck those 4 words per mm if we made mmput_async() depend on CONFIG_ANDROID_BINDER_IPC. Signed-off-by: Jann Horn --- include/linux/mm_types.h | 2 ++ kernel/fork.c | 16 ---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 764d251966c7..8fde2068bde1 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -560,7 +560,9 @@ struct mm_struct { #ifdef CONFIG_HUGETLB_PAGE atomic_long_t hugetlb_usage; #endif +#ifdef CONFIG_MMU struct work_struct async_put_work; +#endif } __randomize_layout; =20 /* diff --git a/kernel/fork.c b/kernel/fork.c index 4383bf055b40..c5f2ec544933 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -666,22 +666,6 @@ void __mmdrop(struct mm_struct *mm) } EXPORT_SYMBOL_GPL(__mmdrop); =20 -static void mmdrop_async_fn(struct work_struct *work) -{ - struct mm_struct *mm; - - mm =3D container_of(work, struct mm_struct, async_put_work); - __mmdrop(mm); -} - -static void mmdrop_async(struct mm_struct *mm) -{ - if (unlikely(atomic_dec_and_test(&mm->mm_count))) { - INIT_WORK(&mm->async_put_work, mmdrop_async_fn); - schedule_work(&mm->async_put_work); - } -} - static inline void free_signal_struct(struct signal_struct *sig) { taskstats_tgid_free(sig); --=20 2.29.0.rc1.297.gfa9743e501-goog