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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 D1404C46466 for ; Fri, 2 Oct 2020 21:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E0F3208C7 for ; Fri, 2 Oct 2020 21:28:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="T9S8Ib37" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725765AbgJBV2Z (ORCPT ); Fri, 2 Oct 2020 17:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgJBV2Z (ORCPT ); Fri, 2 Oct 2020 17:28:25 -0400 Received: from mail-oo1-xc43.google.com (mail-oo1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592FFC0613D0 for ; Fri, 2 Oct 2020 14:28:25 -0700 (PDT) Received: by mail-oo1-xc43.google.com with SMTP id y25so720064oog.4 for ; Fri, 02 Oct 2020 14:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=T9S8Ib37E0nEAzt58/3mFKBcYQZBL+AUZWg1RHKEI8YcEgkzl+zhg+iUyJcShofLym adUy3VXYaVJw4qH0ARA2opXokbhprcecl+xiECKEHSPNPKANK9N041AL1hOWHcZxTISz 75/8QopBKHILebHvJPZCrLtxRg5XQ9sss/ad/Fj7yHOuH8HgviF0halDHMmt+OLPCc46 a32zRvTWfMF/tIVNl2CVHZM3rjchAMQNqj76PE4HOP6RTztczmN4lU4pNfoP12ymVF1D +qutItDnQ2A65FnuPYHsSWxi2ag2I5uWo5diCMXDjG37okMaISf9tYs8byUgPIDGLW7J xG8g== 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; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=Oqr7p45TqUsZPWzObDSSa8LiPqPAV5cIkazz/THJHzrfcJYwYjdpHeSODwhlwk5hVb 4U261Xn6r6eLUs8ZEmbG6U4JVxjluLBMEgva3vCKy18U9tJ0zfLkHJRROeq757BKy32J oOSZduClU7d1zFgRiTBXjrQAN/Rs5kV25EgbAHb/9KaIL8oiOyYvHtWhyKAxtoxYenad SoTAjbJ4t0j2Pqzneoo/oBwHcD73Mgfx5Mi5Mbed5Xxd2lyznb3xZ/8+E4M8ynHO6I0m fP2vvZE3Diz7ek9hGxf5kH/oe0rlVEGeXfPpVa9ttzriTeyxwUcSfJ0i3o+hUr/Bxxfv JEJA== X-Gm-Message-State: AOAM533Kpzn4pNQHUiO7+jLMEOsPBx8F5x+4S+/MrEr9sUA5CHoOOpgK BrgPZaDxYElIqzFXiZaccmPXWdT4RARpK8dnYATiiw== X-Google-Smtp-Source: ABdhPJxOUoZnl87DrHfbRoTmo20SXV41YO+PeAn+DWWBv9LR0ddLe4qAXxw5Nx6yNfCgJCH4HtSP2kXaFFs8y0NqANA= X-Received: by 2002:a4a:4fd0:: with SMTP id c199mr3387390oob.54.1601674104417; Fri, 02 Oct 2020 14:28:24 -0700 (PDT) MIME-Version: 1.0 References: <20200929133814.2834621-1-elver@google.com> <20200929133814.2834621-2-elver@google.com> <20201002171959.GA986344@elver.google.com> In-Reply-To: From: Marco Elver Date: Fri, 2 Oct 2020 23:28:12 +0200 Message-ID: Subject: Re: [PATCH v4 01/11] mm: add Kernel Electric-Fence infrastructure To: Jann Horn Cc: Andrew Morton , Alexander Potapenko , "H . Peter Anvin" , "Paul E . McKenney" , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Christoph Lameter , Dave Hansen , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Hillf Danton , Ingo Molnar , Jonathan Cameron , Jonathan Corbet , Joonsoo Kim , Kees Cook , Mark Rutland , Pekka Enberg , Peter Zijlstra , SeongJae Park , Thomas Gleixner , Vlastimil Babka , Will Deacon , "the arch/x86 maintainers" , "open list:DOCUMENTATION" , kernel list , kasan-dev , Linux ARM , Linux-MM , SeongJae Park Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Oct 2020 at 21:32, Jann Horn wrote: > > That's another check; we don't want to make this more expensive. > > Ah, right, I missed that this is the one piece of KFENCE that is > actually really hot code until Dmitry pointed that out. > > But actually, can't you reduce how hot this is for SLUB by moving > is_kfence_address() down into the freeing slowpath? At the moment you > use it in slab_free_freelist_hook(), which is in the super-hot > fastpath, but you should be able to at least move it down into > __slab_free()... > > Actually, you already have hooked into __slab_free(), so can't you > just get rid of the check in the slab_free_freelist_hook()? I missed this bit: the loop that follows wants the free pointer, so I currently see how this might work. :-/ We'll look at your other email re optimizing is_kfence_address() next week; and thank you for the detailed comments thus far! Thanks, -- Marco 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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 050AEC35257 for ; Fri, 2 Oct 2020 21:28:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6894F207EA for ; Fri, 2 Oct 2020 21:28:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="T9S8Ib37" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6894F207EA 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 98ECE6B0072; Fri, 2 Oct 2020 17:28:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 917EB6B0073; Fri, 2 Oct 2020 17:28:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 790E46B0074; Fri, 2 Oct 2020 17:28:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id 40EBA6B0072 for ; Fri, 2 Oct 2020 17:28:26 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D65753635 for ; Fri, 2 Oct 2020 21:28:25 +0000 (UTC) X-FDA: 77328274170.20.flag47_460f269271a7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id B2F05180C07A3 for ; Fri, 2 Oct 2020 21:28:25 +0000 (UTC) X-HE-Tag: flag47_460f269271a7 X-Filterd-Recvd-Size: 5113 Received: from mail-oo1-f65.google.com (mail-oo1-f65.google.com [209.85.161.65]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Fri, 2 Oct 2020 21:28:25 +0000 (UTC) Received: by mail-oo1-f65.google.com with SMTP id w25so716603oos.10 for ; Fri, 02 Oct 2020 14:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=T9S8Ib37E0nEAzt58/3mFKBcYQZBL+AUZWg1RHKEI8YcEgkzl+zhg+iUyJcShofLym adUy3VXYaVJw4qH0ARA2opXokbhprcecl+xiECKEHSPNPKANK9N041AL1hOWHcZxTISz 75/8QopBKHILebHvJPZCrLtxRg5XQ9sss/ad/Fj7yHOuH8HgviF0halDHMmt+OLPCc46 a32zRvTWfMF/tIVNl2CVHZM3rjchAMQNqj76PE4HOP6RTztczmN4lU4pNfoP12ymVF1D +qutItDnQ2A65FnuPYHsSWxi2ag2I5uWo5diCMXDjG37okMaISf9tYs8byUgPIDGLW7J xG8g== 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; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=NQeYlJUVOSUZVBFzBmWWoKoAn/TtUJA0ZKR3mFTA7whMEswoZGS64+lpAPeiz2abJf wqlOANolfHKLMgt1Rn8SKJyy8XP9VrI+4FeVebzCzU7WcqLtZgOEeHP+cICXifn+Z3PU Dwd3cydvD1J0S9ieALqRUFhJkLtNQXq4YibuZdW8Y/BBc8BASTnUVva1j9xt5FwVmHbN +DUvvqaxvke5Vnuf0JwrUE360A4wb2wAKYYKuEIzjNlNXnQ8RVYTBb26Z28XeieWqvnr kYy5rkO9IGYS0YnWO9zKder6PiIWerWo1m1VkN/bqx6JXsmstoCXB31i9YUn9ms3KhzD xROw== X-Gm-Message-State: AOAM532be/CuLgqXWSkk8URGNW0F2cbRYjg4PmLXz0zG4qcqPI6QEh60 zCiwMVyMN7zF4QGSoJJypBmcdvtsGha/lcK7evU5kg== X-Google-Smtp-Source: ABdhPJxOUoZnl87DrHfbRoTmo20SXV41YO+PeAn+DWWBv9LR0ddLe4qAXxw5Nx6yNfCgJCH4HtSP2kXaFFs8y0NqANA= X-Received: by 2002:a4a:4fd0:: with SMTP id c199mr3387390oob.54.1601674104417; Fri, 02 Oct 2020 14:28:24 -0700 (PDT) MIME-Version: 1.0 References: <20200929133814.2834621-1-elver@google.com> <20200929133814.2834621-2-elver@google.com> <20201002171959.GA986344@elver.google.com> In-Reply-To: From: Marco Elver Date: Fri, 2 Oct 2020 23:28:12 +0200 Message-ID: Subject: Re: [PATCH v4 01/11] mm: add Kernel Electric-Fence infrastructure To: Jann Horn Cc: Andrew Morton , Alexander Potapenko , "H . Peter Anvin" , "Paul E . McKenney" , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Christoph Lameter , Dave Hansen , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Hillf Danton , Ingo Molnar , Jonathan Cameron , Jonathan Corbet , Joonsoo Kim , Kees Cook , Mark Rutland , Pekka Enberg , Peter Zijlstra , SeongJae Park , Thomas Gleixner , Vlastimil Babka , Will Deacon , "the arch/x86 maintainers" , "open list:DOCUMENTATION" , kernel list , kasan-dev , Linux ARM , Linux-MM , SeongJae Park 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: On Fri, 2 Oct 2020 at 21:32, Jann Horn wrote: > > That's another check; we don't want to make this more expensive. > > Ah, right, I missed that this is the one piece of KFENCE that is > actually really hot code until Dmitry pointed that out. > > But actually, can't you reduce how hot this is for SLUB by moving > is_kfence_address() down into the freeing slowpath? At the moment you > use it in slab_free_freelist_hook(), which is in the super-hot > fastpath, but you should be able to at least move it down into > __slab_free()... > > Actually, you already have hooked into __slab_free(), so can't you > just get rid of the check in the slab_free_freelist_hook()? I missed this bit: the loop that follows wants the free pointer, so I currently see how this might work. :-/ We'll look at your other email re optimizing is_kfence_address() next week; and thank you for the detailed comments thus far! Thanks, -- Marco 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, 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 D4DA8C4363D for ; Fri, 2 Oct 2020 21:30:23 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D9AD206DB for ; Fri, 2 Oct 2020 21:30:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mW0n6JNP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="T9S8Ib37" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D9AD206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=V20XT27l/C99lSryzF9ecdAv8TkQvXRO90wqeOMeZMI=; b=mW0n6JNPYZ6QbefL9rjO0yD2L +OfrfQNTd+j5WRUV77YRtdZ9QFYm+xtcVMhlMIBqSzmRQ421JSBDpwuUYn3Rbs2ymIOHLlO408zWf 8GNO4WCqG6J51V1WnqEoPmdkLoegfWYk54RXwU2fsvbwrp9J03OcM7wIDsmwj8jrEpyYESWlgmEDt E7SRPze4MbTYBAibHkh9YSUO0H3WflZa+1NbzpoXJpg1heuFm7DoEmsedeoEP3EbU6cD8zA9CiFnk FOVy5DevJ3Z0pdTp/UGnd79TXk+kKNQGaejINvxe0/2eOOfMBWjNZnas/EE1NIn9RlO7G1IrchwgK 5+nGDvGDg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOSbN-0002Oz-LL; Fri, 02 Oct 2020 21:28:29 +0000 Received: from mail-oo1-xc41.google.com ([2607:f8b0:4864:20::c41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOSbK-0002NS-SP for linux-arm-kernel@lists.infradead.org; Fri, 02 Oct 2020 21:28:28 +0000 Received: by mail-oo1-xc41.google.com with SMTP id t3so716396ook.8 for ; Fri, 02 Oct 2020 14:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=T9S8Ib37E0nEAzt58/3mFKBcYQZBL+AUZWg1RHKEI8YcEgkzl+zhg+iUyJcShofLym adUy3VXYaVJw4qH0ARA2opXokbhprcecl+xiECKEHSPNPKANK9N041AL1hOWHcZxTISz 75/8QopBKHILebHvJPZCrLtxRg5XQ9sss/ad/Fj7yHOuH8HgviF0halDHMmt+OLPCc46 a32zRvTWfMF/tIVNl2CVHZM3rjchAMQNqj76PE4HOP6RTztczmN4lU4pNfoP12ymVF1D +qutItDnQ2A65FnuPYHsSWxi2ag2I5uWo5diCMXDjG37okMaISf9tYs8byUgPIDGLW7J xG8g== 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; bh=zH8zzrg+xXVXd7NQ8OqgeM7KZ5LB+ZSk1cWcX09tTBI=; b=NpZdFMTnHEzfCUgylbwcr7inBWQ0Kxx/Lwg/v0SMwlTYYXMqNnZ6OMaBdLQFJxfkjG mlyYc2ug/CJfHqITHMrl/JMsmcBmc51C3BjDBSlaQzRczPs/ns0dKLgc/i8MJzaDtL5M 6ERpJtaF2WMZxNPmqZyK+vMqjknPv5NyNQkUIYgK+Fx/vSRt30a4CdLx2/qF17vpRdjB ePMoMpuDa8GBO3y+igDAzsc8YYoVI1jH1GimsItVjZ5qTt5mKbp7zWnvqaaQldAAmeAY /uKTJQyCtMDuZbcPs+QYYRhbpwCrJiZL9BwNXwW6TbTx7ZYlMZEgjXws/9n2FFaQOEmx mdug== X-Gm-Message-State: AOAM533WxSSxSjjVlpeJP18u16CH1b1cP1o3ZNlztOYL9Gso18EhUSCw Ht03EfYzjPN0fwCXR+4KN6LeXAhkB65t7PTzokGIrw== X-Google-Smtp-Source: ABdhPJxOUoZnl87DrHfbRoTmo20SXV41YO+PeAn+DWWBv9LR0ddLe4qAXxw5Nx6yNfCgJCH4HtSP2kXaFFs8y0NqANA= X-Received: by 2002:a4a:4fd0:: with SMTP id c199mr3387390oob.54.1601674104417; Fri, 02 Oct 2020 14:28:24 -0700 (PDT) MIME-Version: 1.0 References: <20200929133814.2834621-1-elver@google.com> <20200929133814.2834621-2-elver@google.com> <20201002171959.GA986344@elver.google.com> In-Reply-To: From: Marco Elver Date: Fri, 2 Oct 2020 23:28:12 +0200 Message-ID: Subject: Re: [PATCH v4 01/11] mm: add Kernel Electric-Fence infrastructure To: Jann Horn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_172827_047785_EACCEF0A X-CRM114-Status: GOOD ( 17.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Hillf Danton , "open list:DOCUMENTATION" , Peter Zijlstra , Catalin Marinas , Dave Hansen , SeongJae Park , Linux-MM , Eric Dumazet , Alexander Potapenko , "H . Peter Anvin" , Christoph Lameter , Will Deacon , SeongJae Park , Jonathan Corbet , the arch/x86 maintainers , kasan-dev , Ingo Molnar , Vlastimil Babka , David Rientjes , Andrey Ryabinin , Kees Cook , "Paul E . McKenney" , Andrey Konovalov , Borislav Petkov , Andy Lutomirski , Jonathan Cameron , Thomas Gleixner , Andrew Morton , Dmitry Vyukov , Linux ARM , Greg Kroah-Hartman , kernel list , Pekka Enberg , Joonsoo Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 2 Oct 2020 at 21:32, Jann Horn wrote: > > That's another check; we don't want to make this more expensive. > > Ah, right, I missed that this is the one piece of KFENCE that is > actually really hot code until Dmitry pointed that out. > > But actually, can't you reduce how hot this is for SLUB by moving > is_kfence_address() down into the freeing slowpath? At the moment you > use it in slab_free_freelist_hook(), which is in the super-hot > fastpath, but you should be able to at least move it down into > __slab_free()... > > Actually, you already have hooked into __slab_free(), so can't you > just get rid of the check in the slab_free_freelist_hook()? I missed this bit: the loop that follows wants the free pointer, so I currently see how this might work. :-/ We'll look at your other email re optimizing is_kfence_address() next week; and thank you for the detailed comments thus far! Thanks, -- Marco _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel