Spaces of generalized smoothness in the critical case: Optimal