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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 58154C4CED1 for ; Fri, 4 Oct 2019 17:04:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EDF24222C2 for ; Fri, 4 Oct 2019 17:04:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lSfJK+az" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EDF24222C2 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 362756B0003; Fri, 4 Oct 2019 13:04:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 314036B0005; Fri, 4 Oct 2019 13:04:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 202CF6B0006; Fri, 4 Oct 2019 13:04:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0195.hostedemail.com [216.40.44.195]) by kanga.kvack.org (Postfix) with ESMTP id F30716B0003 for ; Fri, 4 Oct 2019 13:04:22 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 8A1AB181AC9B4 for ; Fri, 4 Oct 2019 17:04:22 +0000 (UTC) X-FDA: 76006725564.21.truck23_6056f2e7ad71a X-HE-Tag: truck23_6056f2e7ad71a X-Filterd-Recvd-Size: 4081 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Oct 2019 17:04:21 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id u28so4981150lfc.5 for ; Fri, 04 Oct 2019 10:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sKmO7SSGs5Cj3Low4MPSsnNOVRF1CxTmZDKDuQzI3fM=; b=lSfJK+azzJRqFzTecF/yotk8HmWx/8su3AWMiN03qdPOl9to1345PPk0ASWd8IKFOD oPYoKgkESWbvzNMbHJzcxLGZ1Sgpi1psKEOPpjPQcW9qcOzh17P+UB84I53/b92Y2d7E VvonxTSEJ9yP8KkInJkGHpaaraEs5MIsqQXD/h08VFVokD5cKwqYlf0VFrKCpFlcjXqz g1x8noZF0SAqqHzHMaoG6c5iXUoafIe6nkoB1n/4EqMSz4aK1+3wSpehSWupPp7Iyzc5 iXdaKjoAhXpdjhuwq8HTvVCoXnRVEgqBqHcuRPxCMI91SYM5apZIAqOP3e3TEnU2FSu5 brlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sKmO7SSGs5Cj3Low4MPSsnNOVRF1CxTmZDKDuQzI3fM=; b=IAd/ZWmytay1/ZABO/oYPZy4rhaH1NBYLZ86xz9DrptxvXbfbc2nBiDCW6hTmm8HNu 5J5YB1PddpQCPNPJRb+HjE20BCLJ7mHeSowZuk64zXIOBvoeFtvtyyeT1zV5nlqHYibz 8PfWXC5BO8mgfROVTENkY79I1mchim5W4OkdojWzo2N9Nx/w+KzxIlkz8TAzVfpIQ21R q2HvFvrvzapQOGySKYSFPcAw4J/k8fVhNqRIhVo1HzyQMH7HwZgaZTkmMScG+RWmNWA6 Z39J8BQhSVvZJXXxYyqSAJeQDsMz7DEEQV9CnMq42SjTOMXqZmDOpFElqwfFDkvkfzEF L/OA== X-Gm-Message-State: APjAAAVGDkaoZpnn04PA+ZdOZCVTgZNf9FsI+Tumv7bc79rAQAY1AOOl GFmty4I5wqSUAAtoyfC9tQs= X-Google-Smtp-Source: APXvYqx7EtofMP0XWGkulzAk/7zhZa0zIkQhvEck8McSJ/pwIH5lI0GleoBMmt4sJQ2AsuBZiW3wtA== X-Received: by 2002:ac2:5504:: with SMTP id j4mr1448951lfk.186.1570208660337; Fri, 04 Oct 2019 10:04:20 -0700 (PDT) Received: from pc636 ([37.139.158.167]) by smtp.gmail.com with ESMTPSA id v22sm1373111ljh.56.2019.10.04.10.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2019 10:04:19 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Fri, 4 Oct 2019 19:04:11 +0200 To: Sebastian Andrzej Siewior Cc: Uladzislau Rezki , Daniel Wagner , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] mm: vmalloc: Use the vmap_area_lock to protect ne_fit_preload_node Message-ID: <20191004170411.GA31114@pc636> References: <20191003090906.1261-1-dwagner@suse.de> <20191004153728.c5xppuqwqcwecbe6@linutronix.de> <20191004162041.GA30806@pc636> <20191004163042.jpiau6dlxqylbpfh@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191004163042.jpiau6dlxqylbpfh@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > > You could have been migrated to another CPU while > memory has been allocated. > That is true that we can migrate since we allow preemption when allocate. But it does not really matter on which CPU an allocation occurs and whether we migrate or not. If we land on another CPU or still stay on the same, we will check anyway one more time if it(another/same CPU) is preloaded or not: preempt_disable(); if (__this_cpu_cmpxchg(ne_fit_preload_node, NULL, pva) if another, we can free the object allocated on previous step if it already has it. If another CPU does not have it, save it in ne_fit_preload_node for another current CPU to reuse later. Further we can not migrate because of: spin_lock(&vmap_area_lock); preempt_enable(); -- Vlad Rezki