From patchwork Mon Jul 25 09:52:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12927927 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD243C433EF for ; Mon, 25 Jul 2022 09:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233694AbiGYJxf (ORCPT ); Mon, 25 Jul 2022 05:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbiGYJxe (ORCPT ); Mon, 25 Jul 2022 05:53:34 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39B74167FF for ; Mon, 25 Jul 2022 02:53:33 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id v13so7400857wru.12 for ; Mon, 25 Jul 2022 02:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A3sihs00hh7yUsVGm61oPxJU/8E8nz9XVaw8rankcW8=; b=ey2T+l1twleuG+OFLy9ixDezRiqsXOosmaT+VNL4km6nC26+SIIaK83Y7DUaeyhg09 LoV6IrhMc1lyr7TKdDteQkatIvvl7I2NtYBRIsrKNb1UIGdjgrsY/C6q4flD12Dr+Nhp xQLhUakkqcg/y39b+4TwNsjT94N1YwaYwVsX5JxloKhMI/cn79NGLN3oPZelRGFuFC6l 0rkiIT0xXfNPufAFrSnWSg/mD4lLASACiCG6gkraoLocATUm0ey6NlgYzyy+FH3QDfSl wLENtuHdiPDfkhxkqWulj01c6ll5i1QedYDIjQVZRRLG4kEx5cB3E5I0ycS7Vu6xzG0l 9ljQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A3sihs00hh7yUsVGm61oPxJU/8E8nz9XVaw8rankcW8=; b=QxBcWdTh2RQ1+cmWSmjhCsds6N6k8c+rwAvBolmWka6Aa1FwE0vW42uIQb0h20lY00 KcjP1L3XQ/YHt5HTGusgy9w+GhOx7ywbPtkxpKQRrZtFzPRjy6+vtc5mMWBiVOzc/gI6 hRMCVg7X+0ipnJliU2b84FMhAEP0p++hkxDdwQGTsv1ZvlVDztcJ9dyknFFkZ5OKYnAx kksUiHdwuVCJv+SXsU8m5AlufqsUlVDdBeZhXBPpZy9Kq9u92rcHHe8ZNhYneqOKGqDx ZqJ5dS92vfRI5ikLmD3J79jrKOPRaO1MB8r6vEIzXXejifDZbZg3OrMSqLQShdSWPCOs 5V6Q== X-Gm-Message-State: AJIora+gT0txJUum5k+xsnWM+rK+bxrG5jPHKHGBpxii68iLdrUihvdi W6ZUyy11Xf6NNvKXHYrJiG5wqUk5PJulnw== X-Google-Smtp-Source: AGRyM1tV6ozSF8UOe5fzBkqnm0OEmKIDQSvJAHqzcXcll2hT+9hTADxkfvTqwU2LgQrDJI7LLL3kzw== X-Received: by 2002:a5d:5089:0:b0:21e:734e:24c6 with SMTP id a9-20020a5d5089000000b0021e734e24c6mr6113481wrt.42.1658742811264; Mon, 25 Jul 2022 02:53:31 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c093:600::1:1720]) by smtp.gmail.com with ESMTPSA id n12-20020a05600c3b8c00b003a2ed2a40e4sm18909636wms.17.2022.07.25.02.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 02:53:30 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 1/4] io_uring/net: improve io_get_notif_slot types Date: Mon, 25 Jul 2022 10:52:03 +0100 Message-Id: X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Don't use signed int for slot indexing. Signed-off-by: Pavel Begunkov --- io_uring/notif.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/notif.h b/io_uring/notif.h index 6cd73d7b965b..3e05d2cecb6f 100644 --- a/io_uring/notif.h +++ b/io_uring/notif.h @@ -67,7 +67,7 @@ static inline struct io_notif *io_get_notif(struct io_ring_ctx *ctx, } static inline struct io_notif_slot *io_get_notif_slot(struct io_ring_ctx *ctx, - int idx) + unsigned idx) __must_hold(&ctx->uring_lock) { if (idx >= ctx->nr_notif_slots) From patchwork Mon Jul 25 09:52:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12927928 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EACD4C433EF for ; Mon, 25 Jul 2022 09:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbiGYJxm (ORCPT ); Mon, 25 Jul 2022 05:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbiGYJxk (ORCPT ); Mon, 25 Jul 2022 05:53:40 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B666E17049 for ; Mon, 25 Jul 2022 02:53:38 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id l15so11126254wro.11 for ; Mon, 25 Jul 2022 02:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sinLQ20yM4qKTkg/oyuzo+DXzfh3EUo3lAFbL25qdqs=; b=BrOMhMeF39zBFDfjqdDUWvU/k+JqPqhXxEpkd0ZSWw2H7EMhlWmwBruRyX9htxPFXH v+bVW2VBLLUMdFbu9/EQU0SGNQOGqdcsmd+ZaVvD9ypl/Jk3E2KhlDnsK0wtnOY5RdZp RcqidU0dm6m1HYEUy1UjMnGKV0nJyrSWg7T7oKqqHeSgvUTvDqSkV5/qluEog92+ETvl 8k8DysvukTO0ZmCZ9Q++Wb2xXOKX6Jbq7FxE2hhVEgHc9YyMmz7mh7zAzBhkpoiF247s CDCSctV4ik4OxIRDpSLE9EgAHqnJwBznz7ofQTYs2INWM0/UYHbNbJqRn8xx0qYtwkXt KRJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sinLQ20yM4qKTkg/oyuzo+DXzfh3EUo3lAFbL25qdqs=; b=iHN34X9HFfXlEsrvMSU+XIbaPZ7Gx4iR3UJAdsVT5XlzIEJIKFu+dPUZ0gzcA7M1HL 35ULsA+BngGrelTpEp1BKY8WONKNlghjSfu7O6FJJMIQczxmD/HuxMlavW9NYJkHCQOP 3PvzKnbcCoLhtW9adTjiAzRsfB08NxgyD5OGXg1GtnsUH+bXbsNlZPq8wveaz6RoalIu zo8Zj0VsRQgGj5/51uklt3RAnPi1potxQrpZFD0krGQJWUh6XgX2CXgUJoapSyKrNDSs viy1PXrnNxWg5m4lmh+A02/5PYE11H9P4VBiQ2VJiv5r+BeiW8YFD0Lk/yK8npWiS9BA hl9w== X-Gm-Message-State: AJIora+yPr81wnR0U9bhBq5fQn/rHhr6DW5cxYpdRbtP3XVi05+J7C/d gYfD+G7fviM9sDMZ5rWT3iA6oXe11yA2Cg== X-Google-Smtp-Source: AGRyM1vyJjwt7//2P2N+n+xSfgIaOahMT9aP5yaTidIV07ryPIWE10dotyI0mhoavnSeDd6HEmWuGg== X-Received: by 2002:a05:6000:1888:b0:21d:beeb:7873 with SMTP id a8-20020a056000188800b0021dbeeb7873mr7135592wri.393.1658742816717; Mon, 25 Jul 2022 02:53:36 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c093:600::1:1720]) by smtp.gmail.com with ESMTPSA id n12-20020a05600c3b8c00b003a2ed2a40e4sm18909636wms.17.2022.07.25.02.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 02:53:36 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 2/4] io_uring/net: checks errors of zc mem accounting Date: Mon, 25 Jul 2022 10:52:04 +0100 Message-Id: X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org mm_account_pinned_pages() may fail, don't ignore the return value. Fixes: d3b8269075f67 ("io_uring: account locked pages for non-fixed zc") Signed-off-by: Pavel Begunkov --- io_uring/net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/io_uring/net.c b/io_uring/net.c index 62be89837d82..8fb8469c3315 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -985,7 +985,9 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags) &msg.msg_iter); if (unlikely(ret)) return ret; - mm_account_pinned_pages(¬if->uarg.mmp, zc->len); + ret = mm_account_pinned_pages(¬if->uarg.mmp, zc->len); + if (unlikely(ret)) + return ret; } if (zc->addr) { From patchwork Mon Jul 25 09:52:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12927929 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA0DEC433EF for ; Mon, 25 Jul 2022 09:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232254AbiGYJxp (ORCPT ); Mon, 25 Jul 2022 05:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbiGYJxp (ORCPT ); Mon, 25 Jul 2022 05:53:45 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E7917043 for ; Mon, 25 Jul 2022 02:53:44 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id b26so15193165wrc.2 for ; Mon, 25 Jul 2022 02:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MTnTDrcZSjv/YbBe8gL7V5fAUWxTpbrm1lJ1oNJUf4w=; b=RrFOEUs5uYDk4sl+gNxqOkJW8x3L7CckgdD+sMpjYeFTowwUNn/5baHELy8B9/O8a8 o9Qes/jc3BBhy0ucegnP+pwKNcc8gZhbz0Pf8NHgwXyxKcji589FinuSjQ8ScGJEiTsf vs45xWkryrxySX3JY+NiGDl+eYo+zY/cvs7sPXtQfdE+5XLVBVdYe1KnEn6310N7u2g+ PV9kpicqrKuxjE56/V7XgJP+N9eZ0z1ESaO6j31c819hO3aTuqHy6urgDlPiL98t2WYv 35ZT47AZLhpMmct06uA1Z6laZak/r/Qq8RGW/B/1Tux3EFCwkA4pxZl35n39Wk7OoC/d n0+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MTnTDrcZSjv/YbBe8gL7V5fAUWxTpbrm1lJ1oNJUf4w=; b=jrGmZ3lGOcTNNn7YMQIyS9KzbNhqtqzqOvWHXDvZU1vv5h3oncyRh/XS4z4lu7+Yrf MOLdRTy+WVW/8yiBUeZJ6H+9kc5TFjUUQRmvBopTq7o1ANvG6IjuCWAN8DjXqMNvQlhY 4c3mIh+58hWGpPR1QyCrhFBE197LkkOzkRb9lDYbcuUF4uVcH/QnPthuLX/e0Kkpzbe0 7gfudrvc+dokVlCioquKKsJgWl+pntA82IKOa+PhV4mqMoRJ7MhQSCQLqSL/hjLcqjyr yDB4J/oQ4PaXxW3VwssHtIXV4BUHnMWekrQjaqG/tGfPkZ5ONePxKbrTxQ4EgpykyC4x 53ig== X-Gm-Message-State: AJIora+mlsjIIIcyrbR1HVL/o+cWMJkoZvBFFmOyl0Lp419s8wgjghxC AcMCy3hKadfuggn/O9iWQecAXo1l7FnL+Q== X-Google-Smtp-Source: AGRyM1tiwlTYHhLOmvFQCLO5XPg1WamQ7rlQkwoeLL/SdAWI05PjT0kCxx+7tF4GNCI2NKQFbSscXw== X-Received: by 2002:adf:eb50:0:b0:21e:3d13:3a91 with SMTP id u16-20020adfeb50000000b0021e3d133a91mr6943726wrn.484.1658742822251; Mon, 25 Jul 2022 02:53:42 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c093:600::1:1720]) by smtp.gmail.com with ESMTPSA id n12-20020a05600c3b8c00b003a2ed2a40e4sm18909636wms.17.2022.07.25.02.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 02:53:41 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 3/4] io_uring/net: make page accounting more consistent Date: Mon, 25 Jul 2022 10:52:05 +0100 Message-Id: <4aacfe64bbb81b27f9ecf5d5c219c69a07e5aa56.1658742118.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Make network page accounting more consistent with how buffer registration is working, i.e. account all memory to ctx->user. Signed-off-by: Pavel Begunkov --- io_uring/net.c | 2 +- io_uring/notif.c | 9 ++++----- io_uring/notif.h | 19 +++++++++++++++++++ io_uring/rsrc.c | 12 ++++-------- io_uring/rsrc.h | 9 +++++++++ 5 files changed, 37 insertions(+), 14 deletions(-) diff --git a/io_uring/net.c b/io_uring/net.c index 8fb8469c3315..c13d971c7826 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -985,7 +985,7 @@ int io_sendzc(struct io_kiocb *req, unsigned int issue_flags) &msg.msg_iter); if (unlikely(ret)) return ret; - ret = mm_account_pinned_pages(¬if->uarg.mmp, zc->len); + ret = io_notif_account_mem(notif, zc->len); if (unlikely(ret)) return ret; } diff --git a/io_uring/notif.c b/io_uring/notif.c index a93887451bbb..e986a0ed958c 100644 --- a/io_uring/notif.c +++ b/io_uring/notif.c @@ -14,12 +14,10 @@ static void __io_notif_complete_tw(struct callback_head *cb) struct io_notif *notif = container_of(cb, struct io_notif, task_work); struct io_rsrc_node *rsrc_node = notif->rsrc_node; struct io_ring_ctx *ctx = notif->ctx; - struct mmpin *mmp = ¬if->uarg.mmp; - if (mmp->user) { - atomic_long_sub(mmp->num_pg, &mmp->user->locked_vm); - free_uid(mmp->user); - mmp->user = NULL; + if (notif->account_pages && ctx->user) { + __io_unaccount_mem(ctx->user, notif->account_pages); + notif->account_pages = 0; } if (likely(notif->task)) { io_put_task(notif->task, 1); @@ -121,6 +119,7 @@ struct io_notif *io_alloc_notif(struct io_ring_ctx *ctx, notif->ctx = ctx; notif->uarg.flags = SKBFL_ZEROCOPY_FRAG | SKBFL_DONT_ORPHAN; notif->uarg.callback = io_uring_tx_zerocopy_callback; + notif->account_pages = 0; } notif->seq = slot->seq++; diff --git a/io_uring/notif.h b/io_uring/notif.h index 3e05d2cecb6f..d6f366b1518b 100644 --- a/io_uring/notif.h +++ b/io_uring/notif.h @@ -5,6 +5,8 @@ #include #include +#include "rsrc.h" + #define IO_NOTIF_SPLICE_BATCH 32 #define IORING_MAX_NOTIF_SLOTS (1U << 10) @@ -23,6 +25,8 @@ struct io_notif { /* hook into ctx->notif_list and ctx->notif_list_locked */ struct list_head cache_node; + unsigned long account_pages; + union { struct callback_head task_work; struct work_struct commit_work; @@ -85,3 +89,18 @@ static inline void io_notif_slot_flush_submit(struct io_notif_slot *slot, } io_notif_slot_flush(slot); } + +static inline int io_notif_account_mem(struct io_notif *notif, unsigned len) +{ + struct io_ring_ctx *ctx = notif->ctx; + unsigned nr_pages = (len >> PAGE_SHIFT) + 2; + int ret; + + if (ctx->user) { + ret = __io_account_mem(ctx->user, nr_pages); + if (ret) + return ret; + notif->account_pages += nr_pages; + } + return 0; +} diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 9165fdf64269..59704b9ac537 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -44,17 +44,13 @@ void io_rsrc_refs_drop(struct io_ring_ctx *ctx) } } -static inline void __io_unaccount_mem(struct user_struct *user, - unsigned long nr_pages) -{ - atomic_long_sub(nr_pages, &user->locked_vm); -} - -static inline int __io_account_mem(struct user_struct *user, - unsigned long nr_pages) +int __io_account_mem(struct user_struct *user, unsigned long nr_pages) { unsigned long page_limit, cur_pages, new_pages; + if (!nr_pages) + return 0; + /* Don't allow more pages than we can safely lock */ page_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; diff --git a/io_uring/rsrc.h b/io_uring/rsrc.h index 21813a23215f..f3a9a177941f 100644 --- a/io_uring/rsrc.h +++ b/io_uring/rsrc.h @@ -169,4 +169,13 @@ static inline u64 *io_get_tag_slot(struct io_rsrc_data *data, unsigned int idx) int io_rsrc_update(struct io_kiocb *req, unsigned int issue_flags); int io_rsrc_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); + +int __io_account_mem(struct user_struct *user, unsigned long nr_pages); + +static inline void __io_unaccount_mem(struct user_struct *user, + unsigned long nr_pages) +{ + atomic_long_sub(nr_pages, &user->locked_vm); +} + #endif From patchwork Mon Jul 25 09:52:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 12927930 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E4D5C43334 for ; Mon, 25 Jul 2022 09:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbiGYJxv (ORCPT ); Mon, 25 Jul 2022 05:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbiGYJxu (ORCPT ); Mon, 25 Jul 2022 05:53:50 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D821704C for ; Mon, 25 Jul 2022 02:53:49 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id b26so15193513wrc.2 for ; Mon, 25 Jul 2022 02:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YqG0evu8QU96PZzvZYAhUUI1Uw0ucnERiwnkZnU2xmI=; b=FwAHLQpvj3X7nFNMr0reYM/T/qsF0DRdUPMneChBJlGTuCSFpQY2Envou9WkIHMZFi P09PMRQWDy4I33ay+1NHcu10ceD+6JF77K65Ps7SOKtGL8YybeXF9CLGE9piz/RQOG3l iIJY2BmbaxwsM16rZpgtUtZjklexJASDBRcWLGEuoNbWnw98a7NJXZRTHwZSdcAxV+VG uLftku3M1A3Uh/z+3DDMvCg1Wmoo8yiMEAaYF3ThQC1msQ1Flo/djHpaCCKatzsL9aqT VfxxVDzQ/airqu+SsvsRRWSCV4k4oXXp1irlJ7tiCZZ01zrLy80Clsd8js+gWwn4Ckmf nZxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YqG0evu8QU96PZzvZYAhUUI1Uw0ucnERiwnkZnU2xmI=; b=WJo7g8qEVhXC8YhRJiHBV7li7BHSxjJOrGyE18s3MSfAYnlUGRtcK9OWhfdsPDHnAQ oOctLmRdQub5+SP3iWh2b9GNaIkeB4LnxQBMV4w/WM+hWwpeS4dRpyNOw6vfVt4+iemD pobknqj8Kno1cgnGhBliFwz6M/dloukJXz8KHFNL45Yz+2gt4Zay3ybQ9bxSeygM+SGe 6H1PmGgQEgaW/3XTlcHHodHOOVNOAR35i+EaJ13uagVP3aY4vYTmoYQ25pw3CwGzIbgd EED/CqTsNtGnNNYmRism40CRJ4INa1YuonPTV/LnDUq6y907Qb63ASPIMHY9uGJszxxW 4clA== X-Gm-Message-State: AJIora/2VU/hOyerGFUtZrQs3Kp3Dq5I/NeakgIz7Szo1u6vWDabx9b/ EbsOznyd6GU+DnX0MhD/9nC7MVJ2nz/bqg== X-Google-Smtp-Source: AGRyM1s6o37bI4TRwzlzszVmWTUJk3WkxNOedCx7rSPadwa+QtvAdLRYP5M8lym3tGL71yZXxFBtPw== X-Received: by 2002:a5d:64a3:0:b0:21d:ad9e:afd7 with SMTP id m3-20020a5d64a3000000b0021dad9eafd7mr6991476wrp.524.1658742828928; Mon, 25 Jul 2022 02:53:48 -0700 (PDT) Received: from 127.0.0.1localhost.com ([2620:10d:c093:600::1:1720]) by smtp.gmail.com with ESMTPSA id n12-20020a05600c3b8c00b003a2ed2a40e4sm18909636wms.17.2022.07.25.02.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 02:53:48 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH for-next 4/4] io_uring/net: use unsigned for flags Date: Mon, 25 Jul 2022 10:52:06 +0100 Message-Id: <5cfaed13d3191337b14b8664ca68b515d9e2d1b4.1658742118.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Use unsigned int type for msg flags. Signed-off-by: Pavel Begunkov --- io_uring/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io_uring/net.c b/io_uring/net.c index c13d971c7826..8276b9537194 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -55,10 +55,10 @@ struct io_sr_msg { struct user_msghdr __user *umsg; void __user *buf; }; - int msg_flags; + unsigned msg_flags; + unsigned flags; size_t len; size_t done_io; - unsigned int flags; }; struct io_sendzc {