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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 EFBBAC49EA2 for ; Fri, 18 Jun 2021 02:29:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4CE5613C1 for ; Fri, 18 Jun 2021 02:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233633AbhFRCbq (ORCPT ); Thu, 17 Jun 2021 22:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231289AbhFRCbo (ORCPT ); Thu, 17 Jun 2021 22:31:44 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A8ACC061574 for ; Thu, 17 Jun 2021 19:29:36 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id g22so6551538pgk.1 for ; Thu, 17 Jun 2021 19:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lfPVG5Rlds1gsdNwyYiwTk3qXAK1bjtNSBW/loIyjKY=; b=E2p6v27bJYXXFcPeI5HII06b35v9VeR4Y4LrX8rCAPy1EKcPKWRNCLSeoRvFB6gu7a 20danzHU+5B4CO5YgjmOJsLR+X+AJ+glc5VcTxedFJ3oKqjyLWzZO24FXuUSB+0naqmE k6pwiekhhbjBwqo4/5qvEF6ACa0hCftM65IOE= 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lfPVG5Rlds1gsdNwyYiwTk3qXAK1bjtNSBW/loIyjKY=; b=TxrdDYaY8h0kBiyYEAoj97dYXz5Y1F99+TvA9dErdMLBainFtHL7xPcatg/nMcf/Si nYWklOo5l04RSWyImIrYn7DPMcg7uCDerb64T7fdUD1Pa6fFwB0Xmf1FpFmnU21/5Knp 5uYj4sBOCgZIQ0A23m5NjlJ4ZlCezLqaMOtnWR2dXMzp78cAocPo+VW+LxXqqStQI+31 rOrWA83CFn4NeIlWFF81XKkBIOmEBv183QNvBsfS/FHkK8idq1O+dq3ZoBQnB/wGSckC xwqdiMCP7tW3vclsEkM4JLJWl3Kg6cPLFqXcSA7Ar+dIvu22ABBIbQVkS67JadncuaJn 3rVQ== X-Gm-Message-State: AOAM531WZqmpfy02L9wmLugTRBqskIb/I827lsbWRvXTeW3YFA+fntPU yxtM59gvX9TD9o72OfNdnhptbw== X-Google-Smtp-Source: ABdhPJyS6c3QGhrzjMIrW+aGUG63njKnr2ncdaOY4gTWMcv6MJ1tkZvI9BCbGpvn07MueABqKDk/xQ== X-Received: by 2002:a63:5c4a:: with SMTP id n10mr7829823pgm.279.1623983375774; Thu, 17 Jun 2021 19:29:35 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:51a0:fc:f202:9f8]) by smtp.gmail.com with ESMTPSA id v7sm6368683pfi.187.2021.06.17.19.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 19:29:35 -0700 (PDT) Date: Fri, 18 Jun 2021 11:29:30 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky , Matthew Auld , Jani Nikula , Joonas Lahtinen , David Airlie , Chris Wilson , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: drm/i915: __GFP_RETRY_MAYFAIL allocations in stable kernels Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/06/17 19:27), Daniel Vetter wrote: > > > > So can all allocations in gen8_init_scratch() use > > GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN > > Yeah that looks all fairly broken tbh. The only thing I didn't know was > that GFP_DMA32 wasn't a full gfp mask with reclaim bits set as needed. I > guess it would be clearer if we use GFP_KERNEL | __GFP_DMA32 for these. Looks good. > The commit that introduced a lot of this, including I915_GFP_ALLOW_FAIL > seems to be > > commit 1abb70f5955d1a9021f96359a2c6502ca569b68d > Author: Chris Wilson > Date: Tue May 22 09:36:43 2018 +0100 > > drm/i915/gtt: Allow pagedirectory allocations to fail > > which used a selftest as justification, not real world workloads, so looks > rather dubious. Exactly, the commit we landed internally partially reverts 1abb70f5955 in 4.19 and 5.4 kernels. I don't mind I915_GFP_ALLOW_FAIL and so on, I kept those bits, but we need reclaim. I can reproduce cases when order:0 allocation fails with __GFP_HIGHMEM|__GFP_RETRY_MAYFAIL but succeeds with GFP_KERNEL|__GFP_HIGHMEM|__GFP_RETRY_MAYFAIL ON a side note, I'm not very sure if __GFP_RETRY_MAYFAIL is actually needed. Especially seeing it in syscalls is a bit uncommon: drm_ioctl() i915_gem_context_create_ioctl() i915_gem_create_context() i915_ppgtt_create() setup_scratch_page() // __GFP_RETRY_MAYFAIL But with GFP_KERNEL at least it tries to make some reclaim progress between retries, so it seems to be good enough. 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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 AECCDC2B9F4 for ; Fri, 18 Jun 2021 02:29:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6915161245 for ; Fri, 18 Jun 2021 02:29:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6915161245 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BAD06E855; Fri, 18 Jun 2021 02:29:37 +0000 (UTC) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1673E6E855 for ; Fri, 18 Jun 2021 02:29:36 +0000 (UTC) Received: by mail-pg1-x532.google.com with SMTP id e33so6551020pgm.3 for ; Thu, 17 Jun 2021 19:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lfPVG5Rlds1gsdNwyYiwTk3qXAK1bjtNSBW/loIyjKY=; b=E2p6v27bJYXXFcPeI5HII06b35v9VeR4Y4LrX8rCAPy1EKcPKWRNCLSeoRvFB6gu7a 20danzHU+5B4CO5YgjmOJsLR+X+AJ+glc5VcTxedFJ3oKqjyLWzZO24FXuUSB+0naqmE k6pwiekhhbjBwqo4/5qvEF6ACa0hCftM65IOE= 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lfPVG5Rlds1gsdNwyYiwTk3qXAK1bjtNSBW/loIyjKY=; b=MZGNpe/8xMD31BET3SZwTuhFso6YB6Q575tECQQfx7JN4e2JYx4mwl9SE+k9A05e0v YylU3i+JbA/uHJ60Yz6mvUaVKb4HEmSBvSq02Crzmfo3Wf9J1PuAOq7huT9/7ksybkiU mb8b6VFwWoejTqgjacG5FodUSOxpv6mM5O4OC4aFTUAIpkGr3d4eXvJiVtf+nwQZ6eX9 TBN/PhsPi/BTIRPZGVKpIL12Qd1QoNf9KkdqomSTJ22k6z4EJnKR/AUhmWUhwyeTzesd K42Tpi5qlclKIqRWFR2ZAJCNhrB4Tva7n9rs3AM4fBf0HbWmrb+xDvZJrXPqB8PEO0jX rmow== X-Gm-Message-State: AOAM533L12t6uoLXJYyyuaXIkE5qcsnktYTxxfivtbGqvvgLwN8d6QLM CcErVXbq2Bk0X0WoszemBrqaOw== X-Google-Smtp-Source: ABdhPJyS6c3QGhrzjMIrW+aGUG63njKnr2ncdaOY4gTWMcv6MJ1tkZvI9BCbGpvn07MueABqKDk/xQ== X-Received: by 2002:a63:5c4a:: with SMTP id n10mr7829823pgm.279.1623983375774; Thu, 17 Jun 2021 19:29:35 -0700 (PDT) Received: from google.com ([2409:10:2e40:5100:51a0:fc:f202:9f8]) by smtp.gmail.com with ESMTPSA id v7sm6368683pfi.187.2021.06.17.19.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 19:29:35 -0700 (PDT) Date: Fri, 18 Jun 2021 11:29:30 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky , Matthew Auld , Jani Nikula , Joonas Lahtinen , David Airlie , Chris Wilson , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [Intel-gfx] drm/i915: __GFP_RETRY_MAYFAIL allocations in stable kernels X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On (21/06/17 19:27), Daniel Vetter wrote: > > > > So can all allocations in gen8_init_scratch() use > > GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN > > Yeah that looks all fairly broken tbh. The only thing I didn't know was > that GFP_DMA32 wasn't a full gfp mask with reclaim bits set as needed. I > guess it would be clearer if we use GFP_KERNEL | __GFP_DMA32 for these. Looks good. > The commit that introduced a lot of this, including I915_GFP_ALLOW_FAIL > seems to be > > commit 1abb70f5955d1a9021f96359a2c6502ca569b68d > Author: Chris Wilson > Date: Tue May 22 09:36:43 2018 +0100 > > drm/i915/gtt: Allow pagedirectory allocations to fail > > which used a selftest as justification, not real world workloads, so looks > rather dubious. Exactly, the commit we landed internally partially reverts 1abb70f5955 in 4.19 and 5.4 kernels. I don't mind I915_GFP_ALLOW_FAIL and so on, I kept those bits, but we need reclaim. I can reproduce cases when order:0 allocation fails with __GFP_HIGHMEM|__GFP_RETRY_MAYFAIL but succeeds with GFP_KERNEL|__GFP_HIGHMEM|__GFP_RETRY_MAYFAIL ON a side note, I'm not very sure if __GFP_RETRY_MAYFAIL is actually needed. Especially seeing it in syscalls is a bit uncommon: drm_ioctl() i915_gem_context_create_ioctl() i915_gem_create_context() i915_ppgtt_create() setup_scratch_page() // __GFP_RETRY_MAYFAIL But with GFP_KERNEL at least it tries to make some reclaim progress between retries, so it seems to be good enough. _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx