Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp910752rwb; Fri, 23 Sep 2022 05:59:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nkMhCd8GUNa9VSPIyl7SST9PKv1yAXmJHGcNx0AjslU/QcarjLRzoopJqygDP7P6O4gn7 X-Received: by 2002:a17:907:2c78:b0:779:7327:c897 with SMTP id ib24-20020a1709072c7800b007797327c897mr6724550ejc.657.1663937951793; Fri, 23 Sep 2022 05:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663937951; cv=none; d=google.com; s=arc-20160816; b=qogmkBxya9w8LyMsYhLRmc3Y+x22+hksCA8IW5QpsxohHA1v46p3I1DIjZuvw+/CX1 jwAesRJklNElezVpvb80pooj4WWmDrLZdc3550ztx/5PNI5v7kq5/oGcHks4r5r9UD37 8kCTJVWEx1O2rHCX4DHDCmOT/6uOnt2y1ZSEuWJ67Jqg96PUmMRKQ4wa+7TTeIH25oAB pG+KGk8ysInOZM5MpIlA/mxcQ5dkajFbouKATJKZhbo9SUGy6yoRCZIj180T9gPrmaNY JuWRgND55pIsKoKIKPwHPxTdp9FQhEmfSiLlvxrIeIqDDbiNYpOW/ehFL57iGAtOt81c S7EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pmS68nZVm4iXCZPp4Qh0U6/8RJAPhkELF9+3P7Ye2Gg=; b=nDO8YVOQ+BiL86G1mN06idP9YHOrzTPPRQMhQGzn1z6qXUBiW3HXOxfLSaBJKfYy/9 vWGknYd919ke11vaH7Q18kTQxLB1RV9KSTbCYVcJRiVqCxIjLfi4+GBfA4RVtfKXDd6c 7t9ZCijPFFal52Jr4B9TY9JuXV5BL6fOze8YsH+AnjbGtd3hgsQQfcOK3ndTwhVfRTvF K9DW2JD8ACdJ0suWp98iYzX/KRO8rap12owcBxMrKPU0FOgoeYSa0rgYc8SmjB1rftdB 1FNWLYWEF0zuAZ/mYJdzGFG/3rApg0B2/D9PVGpFu3VPvTioRxtEzLoDSr08Q0Qh197z 9Qbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i8VrLusZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw4-20020a1709066a0400b0077d264918b9si4547709ejc.685.2022.09.23.05.58.42; Fri, 23 Sep 2022 05:59:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i8VrLusZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230421AbiIWMdL (ORCPT + 99 others); Fri, 23 Sep 2022 08:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbiIWMcr (ORCPT ); Fri, 23 Sep 2022 08:32:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 899AC1F61A; Fri, 23 Sep 2022 05:32:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E74866240F; Fri, 23 Sep 2022 12:32:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8E6BC433C1; Fri, 23 Sep 2022 12:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663936364; bh=Fev/xAbFy6dCF9ucIYtx19kMsRsV2B9GzILLEMxl7KU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i8VrLusZ5uePvQXxY5Mcd7BGi1YUArVfDQPr1NkwhErQ0EigpIyVeNCaC68a2fuxI dcPh5rTB8eooSjAoj0sQvmq6Y10oempGoRFrFXZJDPcPCIQvbIggRJS+16m0upMLdD /J9yLiwnUENhZ8NoRmXgZ9Ann7bcrOjt4O6+Qi8U/gj4IgGqmzWqpMTbUOAz6Myx/P 666EfrDI/guIroOhYeWlaxz1Vbvy0ZgvKxc1zvlJV7Fm+bGmx6H+e3t/eRPv0gdZ0z RwXkofn7VRGdJpGtwKU6sCGr2zyYf6m8P+SSnTyDnbZSf22aIQk8gGNKBcDGXpKQRC n1wa9E/VBs53w== Date: Fri, 23 Sep 2022 15:32:40 +0300 From: Jarkko Sakkinen To: Kristen Carlson Accardi Cc: linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, cgroups@vger.kernel.org, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Sean Christopherson Subject: Re: [RFC PATCH 01/20] x86/sgx: Call cond_resched() at the end of sgx_reclaim_pages() Message-ID: References: <20220922171057.1236139-1-kristen@linux.intel.com> <20220922171057.1236139-2-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220922171057.1236139-2-kristen@linux.intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2022 at 10:10:38AM -0700, Kristen Carlson Accardi wrote: > From: Sean Christopherson > > Move the invocation of post-reclaim cond_resched() from the callers of > sgx_reclaim_pages() into the reclaim path itself. sgx_reclaim_pages() > is always called in a loop and is always followed by a call to > cond_resched(). This will hold true for the EPC cgroup as well, which > adds even more calls to sgx_reclaim_pages() and thus cond_resched(). This would be in my opinion better: " In order to avoid repetion of cond_sched() in ksgxd() and sgx_alloc_epc_page(), move the call inside sgx_reclaim_pages(). This will hold true for the EPC cgroup as well, which adds more call sites sgx_reclaim_pages(). " This way it is dead obvious and is better description because it enumerates the consequences (i.e. call sites). BR, Jarkko