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=-6.0 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,USER_AGENT_SANE_1 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 E59F6C4727C for ; Tue, 29 Sep 2020 13:13:24 +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 6827A2145D for ; Tue, 29 Sep 2020 13:13:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3hzi8S4Y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="RNHLBk7i" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6827A2145D 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jse2KCMcvEIbXsJOp6JyBucV8zPBzN51IwJUIDBftO4=; b=3hzi8S4YkXLuj1wI5ebGev9We /Ah7lz707KoUoBIrePwSbjJkwYrT+E3ep4euRGsfo4lBCALULXisiEujYAK1aX+aHe11hPXxs0HAA NvCGOf9X4uR9UDSINeZhYMuEF6PIvMYTAo8rdttEBMh66fhQUAolStTxEIR/kpofweGc5DUvpseP2 xFcCpX6JQ69vC18BeFKYGMj0EpEPjRwrQ9pjUT9lvjeLugT2U8JAcqvkpaoV44LZfWq262z6tfsid u9wMl3hupER3fdmoXz/bd3/CXhzAB7SSlBJSu8NsCr/5N9voeWlRt7rJpPWNSUYdXViZHqZjF+3Zz QRj7hvvdQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNFQI-0005AZ-Af; Tue, 29 Sep 2020 13:12:02 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNFQ2-00054A-6w for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2020 13:11:47 +0000 Received: by mail-wr1-x442.google.com with SMTP id x14so5312621wrl.12 for ; Tue, 29 Sep 2020 06:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4Zoo7sR5M5htbvHNu3bicEUq1AAqj0gs6k4W5/ci+9Q=; b=RNHLBk7i6XR1zMD1p4N6ZqYbYyWG4mssQ7O+gFffzxxHmle0A5/U9YEwjGVqZWhUxh DQIl7RGT3z8N78DcH5EToKU6xktWeegW2yJKIm4P5N6M21o0mJ3HRdLVZAjWadYujsYm XFeSekc+TLgmk0Qxu95Y4U0aXOcie3bPgpcwTA+g/292Vx3HkNq2xn1D2jnkpVDS8d+7 DBl/WzKaHleY9+rrQpEls6TZBtK9635dKBhL5g0rX+RSs7NLDM3660UnFWAT71UVVLdH GrqoUwjZAa6ubaJFcQETRsYLcVH5q22Dnp0s8CQSTEGcZx103ImXkF5fZc7VFh85HATD +eSA== 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:user-agent; bh=4Zoo7sR5M5htbvHNu3bicEUq1AAqj0gs6k4W5/ci+9Q=; b=WkyVilVQY80VKG9dK+9I9Y7T0eQS/5C1tPfolelqZS+EpgNuBx8RNyuX2HO4j7KHBe oMmxRuKG34VH0Ru+3hCw3HfWlIrvAtN8bqO/ZSA7t/KnEdE2v5g/X6NGqKJ18kXw2cUL 2yr9cSb1sixNV+hLNY+D8TEOQSnJrNQG6hqJ0P2DWFInGIDd01/jWNirUnj37qSf72NE TXNhbsoUOTURLnkGbPJk9HkUcdd1Sfq0TW9kfmMpsyP4mMmdU9Iq3YrLJoWlTUBScEca iuomVKlxqTRdDBXQwpL6sRA9UIjKAAKYGmYOv/EDiWF5bGR7EmtanuyUZ8XUfRm7S7pi 4Sdw== X-Gm-Message-State: AOAM533VaSThVKj7dw+mpxw/j/2rQnQS7lCT2RtqAC4mQkOit6+jqeep HpR/HVvYMBEvHAR5MqQ/dCFAbA== X-Google-Smtp-Source: ABdhPJy/x6OJ9PkFKsanJQaxmyzHovoF3ynu7/cmwlQcwnjBTZ7zNLjMOnQyomIwVrgGeAQcVFMTzw== X-Received: by 2002:adf:ee01:: with SMTP id y1mr4452655wrn.2.1601385102792; Tue, 29 Sep 2020 06:11:42 -0700 (PDT) Received: from elver.google.com ([100.105.32.75]) by smtp.gmail.com with ESMTPSA id s12sm5024777wmd.20.2020.09.29.06.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 06:11:41 -0700 (PDT) Date: Tue, 29 Sep 2020 15:11:35 +0200 From: Marco Elver To: Andrey Konovalov Subject: Re: [PATCH v3 01/10] mm: add Kernel Electric-Fence infrastructure Message-ID: <20200929131135.GA2822082@elver.google.com> References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-2-elver@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.4 (2020-06-18) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_091146_280773_50D4C2E5 X-CRM114-Status: GOOD ( 17.32 ) 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 , Linux Memory Management List , Eric Dumazet , Alexander Potapenko , "H. Peter Anvin" , Christoph Lameter , Will Deacon , sjpark@amazon.com, Jonathan Corbet , the arch/x86 maintainers , kasan-dev , Ingo Molnar , Vlastimil Babka , David Rientjes , Andrey Ryabinin , Kees Cook , "Paul E . McKenney" , Jann Horn , Borislav Petkov , Andy Lutomirski , Jonathan.Cameron@huawei.com, Thomas Gleixner , Andrew Morton , Dmitry Vyukov , Linux ARM , Greg Kroah-Hartman , LKML , 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 Tue, Sep 29, 2020 at 02:42PM +0200, Andrey Konovalov wrote: [...] > > + */ > > + index = (addr - (unsigned long)__kfence_pool) / (PAGE_SIZE * 2) - 1; > > Why do we subtract 1 here? We do have the metadata entry reserved for something? Above the declaration of __kfence_pool it says: * We allocate an even number of pages, as it simplifies calculations to map * address to metadata indices; effectively, the very first page serves as an * extended guard page, but otherwise has no special purpose. Hopefully that clarifies the `- 1` here. [...] > > + /* Allocation and free stack information. */ > > + int num_alloc_stack; > > + int num_free_stack; > > + unsigned long alloc_stack[KFENCE_STACK_DEPTH]; > > + unsigned long free_stack[KFENCE_STACK_DEPTH]; > > It was a concious decision to not use stackdepot, right? Perhaps it > makes sense to document the reason somewhere. Yes; we want to avoid the dynamic allocations that stackdepot does. [...] Thanks, -- Marco _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel