From patchwork Wed Jan 13 13:50:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12016835 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 2A2B7C433E0 for ; Wed, 13 Jan 2021 13:50:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7A2D423339 for ; Wed, 13 Jan 2021 13:50:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A2D423339 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E47618D0057; Wed, 13 Jan 2021 08:50:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DF7A48D002E; Wed, 13 Jan 2021 08:50:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D34E88D0057; Wed, 13 Jan 2021 08:50:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id BD09C8D002E for ; Wed, 13 Jan 2021 08:50:22 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7C094180AD81F for ; Wed, 13 Jan 2021 13:50:22 +0000 (UTC) X-FDA: 77700886284.22.bed72_1005e6a2751e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 5C8781803DFE2 for ; Wed, 13 Jan 2021 13:50:22 +0000 (UTC) X-HE-Tag: bed72_1005e6a2751e X-Filterd-Recvd-Size: 3711 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 13:50:21 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id d13so2172755wrc.13 for ; Wed, 13 Jan 2021 05:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZwXBYrJM9qKVPKPYtJI8yjhIvV2KkPeDmKoz+CVJlHc=; b=bzpYCMGS5z3k4l3WIeo2Lh33CM8JjhujxkGFpyyyNRzNKJzzpnLue0cnZxMh4x6oHf eCVl8OSG9Axe1NHmrz+kB6NPuOorAFrwhuNw47MacCmBu0o3Pl3ky2OqtASCKwWM8WIH U9tV1BZt2YEuhGsFV/az7bC5o2QzPVwDZqlBY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZwXBYrJM9qKVPKPYtJI8yjhIvV2KkPeDmKoz+CVJlHc=; b=pZMDGXFsRG8UBxXK4WJBh8A1PNim0VBPnAcM/nM9+iFwNRMYIU2pFOKs2Wo3Xi2HkK 48sMgfYmlcVhe0IWs0mazoeMeSGor3d4r7eBNnl2NARf5baUTXA/bHKUzh9f4dYjbnT0 YzBUZRWS32kr48gvBK37EqvNuUfA90T07cjsotF4kZOZWsO42Q3jAK7ZoOcF/dMIJiC7 WUvU9DSUyPkH8SGwOaPRe321RUWsfV5HsxctvH0Pt6JxKMzEI/XD1Zc0z5SfItJtgwIz QphuQ8L7czUutON5Y9QmA/cuPGO+55VJ1joQhCbzfEYtdikYZe1np+sBDnMYuEy/sjvA d+DA== X-Gm-Message-State: AOAM531YdXv907QNVIMdiK5yYBalh5D2Fll1cA57W6II4owI+StsOToQ wJLjmTnS7iXT0YSwKFjRLA09cA== X-Google-Smtp-Source: ABdhPJzGWphNJohoIPnV14YY+wwm9p1rbZynTvRFgZcJcJLGZeKlK5X9RsGhgorT4nwIxWDzFr/YtA== X-Received: by 2002:a5d:6a4f:: with SMTP id t15mr2841613wrw.62.1610545820608; Wed, 13 Jan 2021 05:50:20 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id u17sm3011205wmj.35.2021.01.13.05.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 05:50:19 -0800 (PST) From: Daniel Vetter To: LKML Cc: Intel Graphics Development , Daniel Vetter , Daniel Vetter , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 1/2] mm/dmapool: Use might_alloc() Date: Wed, 13 Jan 2021 14:50:08 +0100 Message-Id: <20210113135009.3606813-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 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: Now that my little helper has landed, use it more. On top of the existing check this also uses lockdep through the fs_reclaim annotations. Signed-off-by: Daniel Vetter Cc: Andrew Morton Cc: linux-mm@kvack.org --- v2: git add everything ... :-/ --- mm/dmapool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index a97c97232337..f3791532fef2 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -319,7 +320,7 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, size_t offset; void *retval; - might_sleep_if(gfpflags_allow_blocking(mem_flags)); + might_alloc(mem_flags); spin_lock_irqsave(&pool->lock, flags); list_for_each_entry(page, &pool->page_list, page_list) { From patchwork Wed Jan 13 13:50:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 12016837 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 213B6C433E6 for ; Wed, 13 Jan 2021 13:50:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C95623382 for ; Wed, 13 Jan 2021 13:50:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C95623382 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E496C8D0058; Wed, 13 Jan 2021 08:50:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DD22F8D002E; Wed, 13 Jan 2021 08:50:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC1D48D0058; Wed, 13 Jan 2021 08:50:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id AA6208D002E for ; Wed, 13 Jan 2021 08:50:23 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6F024181AEF32 for ; Wed, 13 Jan 2021 13:50:23 +0000 (UTC) X-FDA: 77700886326.22.plot81_33168482751e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 47E251803DFF2 for ; Wed, 13 Jan 2021 13:50:23 +0000 (UTC) X-HE-Tag: plot81_33168482751e X-Filterd-Recvd-Size: 3618 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 13:50:22 +0000 (UTC) Received: by mail-wr1-f44.google.com with SMTP id 91so2195827wrj.7 for ; Wed, 13 Jan 2021 05:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nvT+2CTfKbHCHIxTXmD+DKXWE8FcgOY0OyqMKXLif8Q=; b=NKUIMcSrJVLhOs83499n0cgM2auXTaw3V0wMCpbP6nahPLsfkAPGyoyFNXRG9v4Nsn ikZjMacmCsbVlSXqzqw7YCzLe3NEXA5pvt+0sTC0Uo4RLV/bPoGczi/L2sWLBAJAMKUO S7pQyxfXo/popuIGMo5lZ4TZTZhLrAE7MFZik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nvT+2CTfKbHCHIxTXmD+DKXWE8FcgOY0OyqMKXLif8Q=; b=oXEfEg6b3jRyJsfIEzJBFZ68Sge3tD0tUjMLDJamRDk69O0BvXu+787v38SApvqefL jmNqHpopwZkVK2YJye6Yk7B2efyo+9RXGfbWBt3ihZDSNrTvbvbaPtWUHt6sgML5eE+Z 1nJNIR5POqcFILgYn/edSrnA6giu/CK9qFqM3IV8SDhbl5sqrYRiyDEmTco51UrU7c+5 0MGJrrzl4Kn13m2DOHEwgxsSTWjupE4atAFg8NDBqF9w2khDJFUSVlX3UmodrMZxZ/gH bc+1Y8emgE+VlH3Vqbdeo46rKT8orCGq0Ku3QHx3YMymRAnHJV2XWpEfWQrxk7jVinX6 F7uw== X-Gm-Message-State: AOAM532yK7l/wsG2ApND5ub2/n3SI9jowmDrjU0beuqivK2C3s+bsw3k IcEgCqNOzvswyh4Pz7Ij4q0XLg== X-Google-Smtp-Source: ABdhPJzN633ZtBb+JvWBQCilmzXbJKynfVTWxJR1N9WuCGxfKsOqVbeuxDt7n6vPl6QegJN9+Yzw/w== X-Received: by 2002:a5d:50c3:: with SMTP id f3mr2694952wrt.287.1610545821657; Wed, 13 Jan 2021 05:50:21 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id u17sm3011205wmj.35.2021.01.13.05.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jan 2021 05:50:21 -0800 (PST) From: Daniel Vetter To: LKML Cc: Intel Graphics Development , Daniel Vetter , Daniel Vetter , Andrew Morton , linux-mm@kvack.org Subject: [PATCH 2/2] bdi: Use might_alloc() Date: Wed, 13 Jan 2021 14:50:09 +0100 Message-Id: <20210113135009.3606813-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210113135009.3606813-1-daniel.vetter@ffwll.ch> References: <20210113135009.3606813-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 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: Now that my little helper has landed, use it more. On top of the existing check this also uses lockdep through the fs_reclaim annotations. Signed-off-by: Daniel Vetter Cc: Andrew Morton Cc: linux-mm@kvack.org Reported-by: kernel test robot --- v2: git add everything ... oops --- mm/backing-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index e33797579338..5666a0056580 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -580,7 +580,7 @@ struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi, { struct bdi_writeback *wb; - might_sleep_if(gfpflags_allow_blocking(gfp)); + might_alloc(gfp); if (!memcg_css->parent) return &bdi->wb;