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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5846ECAAD5 for ; Mon, 5 Sep 2022 19:24:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc: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=O6zObhiVTuLiUxpg7Q+VFt0ir+YOxTyZdgyN9/w7wEY=; b=goOXHgVOFg3IUx 0EVRC3cX67XKIHqSlzrUJXTICb+Lalb5Exqf+ib91ztQmTIgx/jfpscwmv2q0zzo4w9ixCe9IlLXx h3mFSqdI4QVXAYMJ0lZruFqXtvwl4l9akgtm4wNV0pqZloOMSWFkneBUBlJvVfL0L9An5v0V0FBV7 D6t2HQ9F3AJhAP5gpHIlGW4yu161i355hMgg82Douw60pMjgb1evBTgiUpMJl4CsDYOk3KFJQAGuE 7dtza82/wAaBKew73nK+Og0rg4A0CsO4lhgodIvX/nPa6gRw93reKNMxA5f/4rsqdrtKpS+b8mfqU tzRlFhUYX9LnKrm/Dy7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVHg1-009BrZ-RS; Mon, 05 Sep 2022 19:22:34 +0000 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVGu7-008T0Q-LX for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 18:33:05 +0000 Received: by mail-io1-xd34.google.com with SMTP id n202so7315195iod.6 for ; Mon, 05 Sep 2022 11:33:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=FNv/KEMtf5XOtkND3AyjhcP/3pLjOBMwZm4O4kjr360=; b=i5KCDSUH/dFt94fpjc7Fphku0Tn3reBabaBpFtdU+oRbFh+e8Cx/DMlqQivEg1MZjm 7FbOvlY6Y9f+9LZ9N+zgTB71z3cagQ2sGfp1oudx0Kv1xpUW6Up8K51vig+01CsmnL3L C3xCWMqLQrpYBGvHC0UNi+yNQ6XvxIjh2dsHMNd34BBtJz1xyaPEvWMxsK55kusb2lJe FYhU7ADU9KYt1l8KwJpBXu48E1hUBJcr2CIqnesgVXkiai+CuNr/V0a+QqiqySxoUimH yIvsq78rMCW0kTv83Fiph1I394+CJ8Hgoqi6ZFAZmMb3pGsqLwLA4vfAoG5DeUW7LJqa cUpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=FNv/KEMtf5XOtkND3AyjhcP/3pLjOBMwZm4O4kjr360=; b=XwB/IaxNdbTHb+ioCeR6dJhp9jY05+E1ryEW79Or6XgNSKVyLBflWAx/Zpq9OpYbhI NQL8ArCywSar+NsSuNxJQOW/oA42Gh3h2iNfPPfnB74c8oq/waru+4LwCVE//4HbKK7S Ap4tRpRYCediEMmMBYXsrHl5UvVC1qh32S9sAqK0gKUS3FQfsBavfk0rs0zMn6O50m/D kjz+olNSQ99M+1T0OAcS9+3ht0SO8U+oYF6jr225QEs89DzghaFq44L0lUdSTSCo78ro 56SXVmBEKr0fB7uGl8B9NOGdC6EIKniy5m10mdfwQtHVJ4WXpCgDbiWXLAjEbCpWzkw0 2tYA== X-Gm-Message-State: ACgBeo2JY3LfVb76j8QHrzK6nqBhWdsn7F5aDLFa+4fvsxEtf/IWzlkT MFSmDVDSd4WvlxY4szX7i4OBhkb82mu+ozO8MncljQ== X-Google-Smtp-Source: AA6agR7tgjJDEPLfwwS1LRrijFcmlJFxoiqhAebJjxrWU7CYsmX7SoR6nKTNAJ7nNJVYWRRFlsmMoE7vtwAV8983goQ= X-Received: by 2002:a02:740b:0:b0:349:bcdd:ca20 with SMTP id o11-20020a02740b000000b00349bcddca20mr28183219jac.110.1662402779688; Mon, 05 Sep 2022 11:32:59 -0700 (PDT) MIME-Version: 1.0 References: <20220901173516.702122-1-surenb@google.com> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 5 Sep 2022 11:32:48 -0700 Message-ID: Subject: Re: [RFC PATCH RESEND 00/28] per-VMA locks proposal To: Michal Hocko Cc: Andrew Morton , Michel Lespinasse , Jerome Glisse , Vlastimil Babka , Johannes Weiner , Mel Gorman , Davidlohr Bueso , Matthew Wilcox , "Liam R. Howlett" , Peter Zijlstra , Laurent Dufour , Laurent Dufour , "Paul E . McKenney" , Andy Lutomirski , Song Liu , Peter Xu , David Hildenbrand , dhowells@redhat.com, Hugh Dickins , Sebastian Andrzej Siewior , Kent Overstreet , David Rientjes , Axel Rasmussen , Joel Fernandes , Minchan Kim , kernel-team , linux-mm , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, LKML X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_113303_757372_9B9305B2 X-CRM114-Status: GOOD ( 23.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Mon, Sep 5, 2022 at 5:32 AM 'Michal Hocko' via kernel-team wrote: > > Unless I am missing something, this is not based on the Maple tree > rewrite, right? Does the change in the data structure makes any > difference to the approach? I remember discussions at LSFMM where it has > been pointed out that some issues with the vma tree are considerably > simpler to handle with the maple tree. Correct, this does not use the Maple tree yet but once Maple tree transition happens and it supports RCU-safe lookups, my code in find_vma_under_rcu() becomes really simple. > > On Thu 01-09-22 10:34:48, Suren Baghdasaryan wrote: > [...] > > One notable way the implementation deviates from the proposal is the way > > VMAs are marked as locked. Because during some of mm updates multiple > > VMAs need to be locked until the end of the update (e.g. vma_merge, > > split_vma, etc). > > I think it would be really helpful to spell out those issues in a greater > detail. Not everybody is aware of those vma related subtleties. Ack. I'll expand the description of the cases when multiple VMAs need to be locked in the same update. The main difficulties are: 1. Multiple VMAs might need to be locked within one mmap_write_lock/mmap_write_unlock session (will call it an update transaction). 2. Figuring out when it's safe to unlock a previously locked VMA is tricky because that might be happening in different functions and at different call levels. So, instead of the usual lock/unlock pattern, the proposed solution marks a VMA as locked and provides an efficient way to: 1. Identify locked VMAs. 2. Unlock all locked VMAs in bulk. We also postpone unlocking the locked VMAs until the end of the update transaction, when we do mmap_write_unlock. Potentially this keeps a VMA locked for longer than is absolutely necessary but it results in a big reduction of code complexity. > > Thanks for working on this Suren! Thanks for reviewing! Suren. > -- > Michal Hocko > SUSE Labs > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel