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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 910E5C433E1 for ; Tue, 26 May 2020 21:59:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 33DBA208E4 for ; Tue, 26 May 2020 21:59:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="nh34cblO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33DBA208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D7367800B6; Tue, 26 May 2020 17:59:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D24F080010; Tue, 26 May 2020 17:59:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C3974800B6; Tue, 26 May 2020 17:59:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id A608280010 for ; Tue, 26 May 2020 17:59:51 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 606A2181AC9CC for ; Tue, 26 May 2020 21:59:51 +0000 (UTC) X-FDA: 76860238182.16.face48_380613126d4d X-HE-Tag: face48_380613126d4d X-Filterd-Recvd-Size: 4081 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 May 2020 21:59:50 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id m44so17568758qtm.8 for ; Tue, 26 May 2020 14:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nl/uXXKU7gTdY5ohqQbCJW8fZVN8yq+KGlncMZ1Utts=; b=nh34cblOgwiv74eH3cFlA/wA4QPin0iFdvZX2diA2WCH+OrXis3zyeuuWzA54DelhQ SuzIIwRk1yEdHMvT1ZAK0iPEx4Gf73gj1m2jCYzx+gJ0MKd6W+qIKfoxn0tVsuedldyz ETY7+HCE0x4OkNgdJkhIpKHjhE9l6dJHPLW5SJgnmaJJySodrzQv8SvNciZrePoNE1if L5ZYy3rMqudBO7SGWL/xh64XXFlZDyBS20E7QoDcNkz5Bd6Hq+VQZOkrFoLl1FkCYwqo qOk/Vn+EXOMcfLvX8ZhfvKqFbEYkf5YQgKuGlljHXQQG3EXc9xXqaOLUh9r/iNPB+4aj yDGw== 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; bh=nl/uXXKU7gTdY5ohqQbCJW8fZVN8yq+KGlncMZ1Utts=; b=RZJbolPhkQFWsjXxqdyR8PZLSr6doT1UPAPWYlv6ogNWaXjqzVMCm9fPv+GrHWgiMI IwZGIHw8mEQFpN7jZO8u4K12Fs/qIcCqG10C1YRUIsfp7FgTFa5fuvFyMHnRm6IFmrNR wJ73cG7ioknmNSPvjCe6R/rlFCfdjXvSQdeRkZYS7Vw6pjkQ2/ALyQ+zDaF2n7X4CjpF lB1LL/btejDLWnuMsqOSkzzk1VB3Xh/wq2wYK/5folQjtP4qRNwm0l4+tOpi0vF2R94a trlADV44jFcqh9iiy8Axgi6YIqvJeYe9uuHZe5PLTeKcRvUDm8CHAvyMqtXzkdERIJdz giyA== X-Gm-Message-State: AOAM532XuRGz5KugnAf7ws61CMbhrenkTQAuqos2nGvN3NKWpiQmGQSQ 9M9hsJUn1yHRtRB+OKakeEpQ4Q== X-Google-Smtp-Source: ABdhPJzX5h84kpHsjgtNxRHPc/cukPKzafKyWsPDDU1bqRVn4uMwJWaSC2lQ6IhSym3XUFrWfm9Nmw== X-Received: by 2002:ac8:34d0:: with SMTP id x16mr1065099qtb.300.1590530389796; Tue, 26 May 2020 14:59:49 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:2921]) by smtp.gmail.com with ESMTPSA id o66sm791243qka.60.2020.05.26.14.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:59:49 -0700 (PDT) Date: Tue, 26 May 2020 17:59:25 -0400 From: Johannes Weiner To: Jens Axboe Cc: io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org Subject: Re: [PATCH 04/12] mm: add support for async page locking Message-ID: <20200526215925.GC6781@cmpxchg.org> References: <20200526195123.29053-1-axboe@kernel.dk> <20200526195123.29053-5-axboe@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200526195123.29053-5-axboe@kernel.dk> 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 Tue, May 26, 2020 at 01:51:15PM -0600, Jens Axboe wrote: > Normally waiting for a page to become unlocked, or locking the page, > requires waiting for IO to complete. Add support for lock_page_async() > and wait_on_page_locked_async(), which are callback based instead. This wait_on_page_locked_async() is actually in the next patch, requiring some back and forth to review. I wonder if this and the next patch could be merged to have the new API and callers introduced together? > allows a caller to get notified when a page becomes unlocked, rather > than wait for it. > > We add a new iocb field, ki_waitq, to pass in the necessary data for this > to happen. We can unionize this with ki_cookie, since that is only used > for polled IO. Polled IO can never co-exist with async callbacks, as it is > (by definition) polled completions. struct wait_page_key is made public, > and we define struct wait_page_async as the interface between the caller > and the core. > > Signed-off-by: Jens Axboe Acked-by: Johannes Weiner